Per-session model override (web + SDK) - #500
Merged
Merged
Conversation
Add an optional `model` on session create so a session can run a model other than its agent's. Web "Start session" dialog gets an optional Model field (placeholder = the agent's model; hidden for flue agents, whose model is pinned in the artifact); web client + TS SDK CreateSessionParams thread `model?` through; docs note the override on POST /v3/sessions. SDK 0.11.2 -> 0.12.0 (version-gated publish, lockstep). Pairs with the sessions-api core enforcement (parallel PR). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
2027 — Waiting for deployment on commit
|
- sessions.mdx: a dedicated ## Model section (what it does, optional/ inherit, precedence, pinned-for-life, flue-rejected) + SDK & REST example. - api-reference.mdx: model? entry in the create-params list (422 for flue). - runtimes.mdx: per-session override note at the model-validation line (same prefix rule; unknown model still fails at first turn; not flue). - flue.mdx: model-triangle row states a session can't override flue's model. - agents.mdx: cross-ref from the snapshot-freeze note. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Model-validation failures throw AgentValidationError -> 400 type:"invalid" (same as provider-mismatch); 422 is reserved for managed_unavailable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Adds an optional
modelto session create so a session can run a model other than its agent's default. This is the web + SDK half; the sessions-api core (accepting/validating/applyingmodelat create) is a parallel PR.Wire contract
POST /v3/sessionsaccepts an optionalmodel?: string. Omitted → inherit the agent's model. Present → the session runs that model. Sameprovider/modelform as the agent's model; must resolve to the agent's runtime's provider. Not for flue (model is pinned in the deployed artifact).Changes
sdks/typescript/src/agents/sessions.ts—model?onCreateSessionParams(type-only;create()already forwards the body verbatim). Version 0.11.2 → 0.12.0 + lockfile (version-gated publish, lockstep rule).web/src/api/client.ts—model?on thecreateSessionbody, passed through.web/src/pages/Sessions.tsx— optional Model field in the Start-session dialog. Empty by default (inherits); placeholder shows the selected agent's model; only sent when non-empty; hidden for flue agents; cleared when the agent changes (a model is runtime-specific).docs/agent-sessions/sessions.mdx— themodeloverride noted on the create flow.Gates
tsc --noEmit✅ +tscbuild ✅npm run typecheck✅ +npm run build✅Notes
web/src/pages/Sessions.tsx+web/src/api/client.ts— independent features, based onmain, reconcile at merge (both add small, non-conflicting hunks: web (W11): sessions dashboard — runtime + spend, richer viewer, submission-health panel #498 adds columns/cells + a body_truncated schema; this adds a dialog field + a bodymodel?).🤖 Generated with Claude Code