Skip to content

Add per-turn (one-shot) model override to sessions.patch and chat-send payload #83565

Description

@swildcat10

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.patch calls 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)

  1. sessions.patch with scope: "next-turn" — patch applies to the next single agent turn and auto-reverts to the prior model on completion.
  2. Per-message model field 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

  • Per-turn override does not change persistent session state.
  • Resolved model for the turn is reported in the response envelope (so agents can populate a visible per-turn signal in their reply).
  • Works with a new modelOverrideSource: "agent" source kind so it does not collide with user overrides.
  • Logged as an override event in any tooling that already consumes sessions.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper 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:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, 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.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions