# Agent9 Runtime Model and Reasoning

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "agent9-runtime-model-reasoning-2026-08-24",
  "problems": [
    {
      "problemId": "agent9-runtime-model-reasoning-not-frozen-from-intended-config",
      "summary": "Agent9-backed auto-oncall could run a Session with a stale model and Codex always forced medium reasoning instead of the linked Agent's intended runtime setting.",
      "status": "candidate",
      "applicability": "Agent9-backed auto-oncall turns whose requested Session model or linked Agent reasoning effort differs from historical defaults.",
      "issueKeys": [],
      "sourceRefs": ["https://github.com/mem9-ai/agent-stack#problem:agent9-runtime-model-reasoning-not-frozen-from-intended-config"],
      "signalTextIncludesAny": [
        "agent9 session used gpt-5.6-luna",
        "codex reasoning effort forced to medium",
        "agent9 runtime model reasoning regression"
      ],
      "observedThrough": "2026-08-24",
      "effectiveAt": null,
      "verifiedAt": null,
      "attemptedAction": "Align each new or resumed Agent9 Session to the AOS requested model before its first Turn, add Codex reasoning effort to the Agent runtime config, freeze it into AgentRun, and pass that frozen value to the Codex SDK request.",
      "evidenceUrl": null
    }
  ]
}
-->

- Owner: Agent Stack Codex Runtime and the AOS Agent9 Session adapter
- Source: Agent9-backed recent-case regression review
- Implementation status: local candidate; not deployed
- Effective status: `candidate`

## Bounded problem

The Agent9 Session model was mutable independently of the AOS request, while
the Codex runtime runner hard-coded `medium` reasoning. An Agent9-backed run
could therefore use a stale Session model and could not preserve the intended
reasoning effort in its immutable AgentRun execution snapshot.

## Candidate change

The AOS adapter aligns the Session model through its ETag-protected public API
before the first Turn for both new and resumed Sessions. Agent Stack adds one
Codex-only reasoning-effort field to Agent runtime config, freezes it into the
AgentRun, and sends that frozen value to the Codex SDK. Pi remains unchanged.

## Verification status

TypeScript builds and focused adapter tests pass. This does not prove runtime
effectiveness because neither candidate is deployed.

## Next validation action

Deploy both merged changes, set the linked auto-oncall Agent to the intended
reasoning effort, and run one read-only case. Verify the durable AgentRun and
Turn event show the intended model and effort, then compare the case result.
