-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Add per-turn (one-shot) model override to sessions.patch and chat-send payload #83565
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Today, all model-override surfaces (
/model,session_status(model=...),sessions.patch, the chat-header picker) write persistent session overrides. There is no atomic single-turn override.For cost-discipline at scale on a multi-tier model routing scheme, agents need to escalate to a higher-tier model for a single turn and auto-revert without explicit cleanup. The sticky-switch workaround works but adds overhead (every phase boundary needs two
sessions.patchcalls and live discipline to revert) and creates a recurring failure mode: the session drifts up-tier when the revert is forgotten, burning higher-cost capacity on turns that do not need it.Proposed API additions (one of)
sessions.patchwithscope: "next-turn"— patch applies to the next single agent turn and auto-reverts to the prior model on completion.modelfield in the chat-send payload — overrides the session model for that send only; resolved model is reported in the response envelope.Either form would replace the sticky-switch protocol with a single atomic operation and eliminate the drift failure mode.
Acceptance criteria
modelOverrideSource: "agent"source kind so it does not collide withuseroverrides.overrideevent in any tooling that already consumessessions.patch.Frame
Required infrastructure for cost-discipline at scale on multi-tier model routing. Sticky-switch works but burdens the agent with discipline drift; atomic per-turn override is the structural fix. Pairs naturally with a visible per-turn model signal in agent replies, which is otherwise hard to populate accurately from a sticky-switch implementation.