Repository navigation
Description
Why
A host that applies a configuration change, such as a new model or reasoning effort, to a running agent usually wants to replace the session instance and resume the same native conversation:
startSession(installation, { resume: previous.id, model: newModel, ... })Whether the new configuration actually takes effect on resume depends on the runtime and on conditions, such as a cold versus an already-loaded thread, or the vendor version. A host can easily get this wrong, and when it does, the session silently runs the old configuration. That is the capability-honesty failure described in foundations.
Evidence from Raft, which already depends on @botiverse/oar:
- Raft forces a full session reset on a Codex model switch because "Codex
thread/resumepins the model of the resumed thread, so a plain restart keeps launching the old model". This came from a production report of a 5.5 → 5.6 switch that did not apply, dated 2026-07-10. The code is inpackages/server/src/routes/agents.ts, in thecodexModelChangedbranch. - OAR's own Codex evidence says something narrower.
thread/resumeapplies themodeloverride on a cold load. It drops the override only when the thread is already loaded on that connection, and the adapter rejects that case through a model readback (codex.md → Resume). The two conclusions conflict. Raft's driver may have hit the loaded-thread case, or run a different version. Nobody can tell from the outside, and that is the problem. - For Pi, a Raft audit on 2026-09-18 found that resuming a session with an explicit new model sends the new model in the HTTP request body, on both 0.84.4 and 0.85.1. This matches pi.md: an explicit
modeloverrides the saved one and is checked by readback.
Current state as documented
| Runtime | Model on resume | Verified? |
|---|---|---|
| codex | thread/resume { model? }. Applied on a cold load, dropped on a loaded thread; the adapter rejects on readback mismatch |
readback + tests |
| pi | An explicit model overrides the saved model. A saved-model fallback's modelFallbackMessage is discarded |
readback |
| claude | --resume <id> plus an optional --model |
not found in docs: unknown |
| grok / kimi (ACP) | session/resume or session/load, then session/set_model |
model event readback |
The other SessionOptions fields are not covered on resume: reasoning effort, systemPrompt and appendSystemPrompt, env, and provider selection. Their resume semantics are unknown per runtime.
Design questions
- Contract. For each runtime, which
SessionOptionsfields are honored on resume? Is each field enforced by readback, declared up front, or answered with a typedunsupported? - API shape. Candidate options:
- (a) Keep
startSession({ resume, ...options }), but make every field either verified or explicitly rejected on resume. Never silently ignore a field. - (b) Add an explicit
resumeWithConfig/resume({ id, overrides })that reports which overrides were applied. - (c) Add a capability declaration, such as
resumeOverrides: { model: "applied" | "rejected" | "unknown", ... }, so a host can choose between "resume with new config" and "start a fresh session" before it opens anything.
- (a) Keep
- Failure. When a runtime cannot honor an override, should the call reject, as Codex does today on readback mismatch? Falling back to a fresh session is host policy, not OAR's, so presumably the answer is to reject with a typed reason.
- Conditions. If behavior depends on connection or loaded state, or on vendor version, how is that condition recorded as evidence and not guessed?
Decision gates (pre-filled)
- Caller decision enabled: when applying a config change, a host decides whether to resume the native session with the new config or to start a fresh session and lose the conversation.
- Evidence that the decision is unsafe today: the Raft Codex report above, and OAR's own loaded-thread override drop.
- Owning layer: Declare and Control (
SessionOptions/ capabilities). - Cheapest regression test: per-runtime resume-with-changed-model tests. Codex and Pi already have readback tests; Claude, grok, and kimi need probes.
- Sea-trial case: "resume with a changed model either runs the new model or rejects, and never silently runs the old one." Extend this to every field the contract covers.
Out of scope
- Cancelling
startSessionmid-start. Abandoning a start by disposing after it resolves is acceptable for the host.
Context
Raft RFC 059 (agent instance lifecycle, botiverse/slock#7986, §4.5) models a config change as "replace the instance and resume the session", and needs this contract to decide which config fields may be applied through resume.
Activity