# Agent9 Execution Trace Accuracy

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "agent9-execution-trace-accuracy-2026-08-24",
  "problems": [
    {
      "problemId": "agent9-trace-records-requested-settings-as-execution-facts",
      "summary": "Auto-oncall context traces could not distinguish requested model and reasoning settings from the values frozen for the actual Agent9 Turn.",
      "status": "candidate",
      "applicability": "Successful or post-start failed Agent9-backed turns inspected through auto-oncall context traces.",
      "issueKeys": [],
      "sourceRefs": ["https://github.com/mem9-ai/agent-stack#problem:agent9-trace-records-requested-settings-as-execution-facts"],
      "signalTextIncludesAny": [
        "trace model differs from agent9 turn",
        "trace reasoning effort is only requested value",
        "agent9 execution config unavailable in context trace"
      ],
      "observedThrough": "2026-08-24",
      "effectiveAt": null,
      "verifiedAt": null,
      "attemptedAction": "Emit the frozen display-safe execution request settings on every new turn_started event and persist those exact values in AOS executionConfig for success and post-start failure; record unavailable instead of copying requested values when metadata is absent.",
      "evidenceUrl": null
    }
  ]
}
-->

- Owner: Agent Stack Turn event contract and AOS context trace projection
- Source: Agent9-backed runtime trace review
- Implementation status: local candidate; not deployed
- Effective status: `candidate`

## Bounded problem

The AOS trace stored request options but Agent9 did not expose the execution
settings frozen into the physical AgentRun. A trace could therefore appear to
prove a model or reasoning value that the Agent9 Turn had not actually used.

## Candidate change

Every new `turn_started` event exposes the frozen backend, model, and Codex
reasoning effort. Historical events remain readable without the additive
field. AOS writes the emitted values to a separate `executionConfig` object;
when metadata is missing it records null values with `source=unavailable`.
Errors raised after `turn_started` retain the same execution projection.

## Verification status

Agent Stack build and OpenAPI generation pass. AOS build and focused trace
tests pass, including a failed Turn after execution metadata was received.
This is branch-local evidence only.

## Next validation action

After both deployments, run one read-only case and compare the live NDJSON
`turn_started` payload, durable replay, and AOS `context-trace.json` values.
