Repository navigation
Answer one prompt on another model with /model <model> <prompt> - #154
Merged
Merged
Conversation
leonardoaraujosantos
force-pushed
the
feat/model-one-shot
branch
3 times, most recently
from
November 20, 2026 03:24
6eaeae8 to
6fca8ac
Compare
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
force-pushed
the
feat/model-one-shot
branch
from
November 20, 2026 18:04
6fca8ac to
a426f22
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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./modeland/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}/prompttakes an optionalmodel(provider/model[#variant]). It flows throughAdmission.model, thesession.prompt.admitted.1event (model, optional and back-compatible) andInboxRow.model, which is visible on inbox rows.InboxRow::turn_model()returns the prompt'smodel, 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.ModelRef::parse, thenresolve_selection. An unknown model is refused and nothing is admitted. The exact-retry digest includesmodel.session.model.switched.1is recorded, andinfo.modeldoes not change.Action::ModelPromptposts the prompt withmodel, with deliverysteer, orqueuewhile the Session runs. A first argument without/followed by text showsUsage: /model <provider/model> <prompt>.Spec and docs
add-one-shot-model-prompt: MODIFIEDsession-runtime"Agent, model, and mode switching" andtui"Model, variant and agent selection", with scenarios. Main specs are updated in the same PR.sdk/openapi.jsonand the TypeScript SDK are regenerated (PromptBody.model,InboxRow.model).Tests
cyber-toolsskill_commands::prompt_model_answers_one_prompt_then_the_session_model_returns(runtime through the tool host):other/oncemodel serves areadtool call and the final answer;info.modelstaystest/main;test/main;cyber-tuiscreens_model_prompt:/modeland/model <name>, the usage toast, trimming, andqueuewhile running;other, the Session still reportstest/main, and the next prompt goes tomain.Notes
ModelPromptmatch arm fromconversetoscheduledto keep cognitive complexity at or below 15, was type-checked by clippy but its tests were not re-run locally. CI runs them.model. The TUI one-shot sends text only.Rebase follow-ups
modelanswers that prompt without suspending the planner, and its steps carry nomodel_role. The spec says so, andplanner::a_one_shot_prompt_model_in_plan_mode_keeps_the_plannerchecks the step order: planner, then the named model, then the planner again.localflag thatperform::partstakes on main. Two commits move theModelPromptmatch arm (first intoscheduled, then intosession_requests) to keep both functions within the cognitive complexity limit of 15.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.review_timeout_cancels_only_the_owned_reviewer_jobuses with 15 s.parallel_workflows::a_killed_server_resumes_its_runs_after_restart_when_configuredfailed 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.