Skip to content

Per-session model override (web + SDK) - #500

Merged
ZIJ merged 3 commits into
mainfrom
feat/per-session-model
Jul 8, 2026
Merged

Per-session model override (web + SDK)#500
ZIJ merged 3 commits into
mainfrom
feat/per-session-model

Conversation

@ZIJ

@ZIJ ZIJ commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds an optional model to 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/applying model at create) is a parallel PR.

Wire contract

POST /v3/sessions accepts an optional model?: string. Omitted → inherit the agent's model. Present → the session runs that model. Same provider/model form 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

  • SDK sdks/typescript/src/agents/sessions.tsmodel? on CreateSessionParams (type-only; create() already forwards the body verbatim). Version 0.11.2 → 0.12.0 + lockfile (version-gated publish, lockstep rule).
  • Web client web/src/api/client.tsmodel? on the createSession body, passed through.
  • Web dialog 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 docs/agent-sessions/sessions.mdx — the model override noted on the create flow.

Gates

  • SDK tsc --noEmit ✅ + tsc build ✅
  • web npm run typecheck ✅ + npm run build
  • byte-scan: no control bytes

Notes

🤖 Generated with Claude Code

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>
@mintlify

mintlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
opencomputer 🟢 Ready View Preview Jul 8, 2026, 3:33 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@2027-evals

2027-evals Bot commented Jul 8, 2026

Copy link
Copy Markdown

2027 — Waiting for deployment on commit d2f19a4...

2027 // complete the getting started guide at https://opencomputer.d — Waiting…

  ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Prompt

complete the getting started guide at https://opencomputer.dev

Commit d2f19a4 · View metrics →


Evaluating agent experience using 2027.dev · View dashboard

- 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>
@ZIJ
ZIJ merged commit 908a5fc into main Jul 8, 2026
2 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