Skip to content

Answer one prompt on another model with /model <model> <prompt> - #154

Merged
leonardoaraujosantos merged 5 commits into
mainfrom
feat/model-one-shot
Nov 21, 2026
Merged

leonardoaraujosantos merged 5 commits into
mainfrom
feat/model-one-shot

Conversation

@leonardoaraujosantos

@leonardoaraujosantos leonardoaraujosantos commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What

/model <provider/model> <prompt> in the TUI sends one prompt to another model. That model answers it, including its tool loop. The Session's model is not switched and answers the next prompt. /model and /model <name> still open the picker, as they do today.

How the override works

The API had no per-prompt model. It did have a per-row "command model": a skill or custom command with model: runs its Turns on that model until its final text reply, then expires. This PR exposes the same mechanism to plain prompts.

  • POST /api/v1/sessions/{id}/prompt takes an optional model (provider/model[#variant]). It flows through Admission.model, the session.prompt.admitted.1 event (model, optional and back-compatible) and InboxRow.model, which is visible on inbox rows.
  • The new InboxRow::turn_model() returns the prompt's model, else the command's. The boundary and command-model selection use it, so the existing expiry rule applies: the override lasts through tool calls and ends at the final text reply.
  • Admission validates the model first: ModelRef::parse, then resolve_selection. An unknown model is refused and nothing is admitted. The exact-retry digest includes model.
  • No session.model.switched.1 is recorded, and info.model does not change.
  • TUI: Action::ModelPrompt posts the prompt with model, with delivery steer, or queue while the Session runs. A first argument without / followed by text shows Usage: /model <provider/model> <prompt>.

Spec and docs

  • OpenSpec change add-one-shot-model-prompt: MODIFIED session-runtime "Agent, model, and mode switching" and tui "Model, variant and agent selection", with scenarios. Main specs are updated in the same PR.
  • Guide: new "One prompt on another model" subsection under the TUI composer section. CHANGELOG updated.
  • sdk/openapi.json and the TypeScript SDK are regenerated (PromptBody.model, InboxRow.model).

Tests

  • cyber-tools skill_commands::prompt_model_answers_one_prompt_then_the_session_model_returns (runtime through the tool host):
    • the other/once model serves a read tool call and the final answer;
    • the main model gets no request, and info.model stays test/main;
    • the next prompt runs on test/main;
    • an unknown model is refused at admission.
  • cyber-tui screens_model_prompt:
    • argument parsing: picker kept for /model and /model <name>, the usage toast, trimming, and queue while running;
    • a production App against a real server: the Turn request for the one-shot prompt goes to other, the Session still reports test/main, and the next prompt goes to main.

Notes

  • Local disk dropped below the 15 GB working limit after clippy, so the last commit, which only moves the ModelPrompt match arm from converse to scheduled to keep cognitive complexity at or below 15, was type-checked by clippy but its tests were not re-run locally. CI runs them.
  • The image/PDF modality check still uses the Session's model, not the prompt model. The TUI one-shot sends text only.

Rebase follow-ups

  • Planner (Planner/executor model split (model_roles.plan) #157). In a plan phase, a prompt model answers that prompt without suspending the planner, and its steps carry no model_role. The spec says so, and planner::a_one_shot_prompt_model_in_plan_mode_keeps_the_planner checks the step order: planner, then the named model, then the planner again.
  • Prompt parts. The TUI now passes the local flag that perform::parts takes on main. Two commits move the ModelPrompt match arm (first into scheduled, then into session_requests) to keep both functions within the cognitive complexity limit of 15.
  • Regression note, review_command::a_budget_stopped_review_workflow_exits_4_with_partial_findings. On this PR's macOS job the test failed on both tries. The provider saw no request at all, and the run stopped at its 2 s budget with no findings. The same test passed in main's last completed macOS run (fd8838b). It also passes on this branch locally.
    • Cause: the budget's clock also covers the reviewer's start (admission, child Session, first provider request), which can take more than 2 s on a loaded runner. Nothing in this PR is on that path.
    • Fix: the test now uses a 20 s budget and holds the reviewer's answer 25 s after its request. The request then comes before the budget expires and the answer after it, which is the same approach review_timeout_cancels_only_the_owned_reviewer_job uses with 15 s.
    • Under a loaded local run with 8 test threads, it took 34 s and passed.
  • parallel_workflows::a_killed_server_resumes_its_runs_after_restart_when_configured failed once on macOS ("Subagent execution ownership is held or requires recovery") and passed on retry. It is unrelated to this change and left as is.

@leonardoaraujosantos
leonardoaraujosantos force-pushed the feat/model-one-shot branch 3 times, most recently from 6eaeae8 to 6fca8ac Compare November 20, 2026 03:24
POST /sessions/{id}/prompt accepts model: that prompt's Turns, tool loop
included, run on it until the final text reply, and the Session keeps
its model with no switch event. It is validated before admission, takes
precedence over a command's model, is reported on the inbox row and is
part of the exact-retry digest. The command-model selection now reads
InboxRow::turn_model.

In the TUI, /model <provider/model> <prompt> sends the prompt with that
model (queued while the Session runs); /model and /model <name> still
open the picker.
Keeps converse within the cognitive complexity limit.
A prompt model in a plan phase answers that prompt without suspending
the planner; covered by a planner test. The TUI passes the local flag
the prompt parts helper now takes.
scheduled gained arms on main and went over the cognitive complexity
limit.
a_budget_stopped_review_workflow_exits_4_with_partial_findings ran a 2 s
wall budget whose clock also covers the reviewer's start. On a loaded
macOS runner the reviewer had not asked the provider within 2 s, so the
run stopped with no findings and the test failed on both tries (main's
run passed). A 20 s budget with the answer held 25 s after the request
keeps the request before and the answer after the budget, as the
review timeout test already does with 15 s.
@leonardoaraujosantos
leonardoaraujosantos merged commit d828c6d into main Nov 21, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant