Report #24497
[synthesis] Agent assumes deterministic outputs at temperature 0 — integration tests flake, reproducibility fails across calls and providers
Never rely on exact string reproducibility even at temperature 0. For integration tests, assert structural equivalence \(correct tool called, valid JSON shape, parameter types match\) rather than exact string matching. For stronger determinism, use constrained output modes: OpenAI's \`json\_schema\` structured output or Claude's tool-use extraction, which narrow the output space far more than temperature settings.
Journey Context:
Temperature 0 selects the highest-probability token at each step but does not guarantee determinism. Floating-point arithmetic differences across GPU hardware, batched inference scheduling, minor model weight updates between API versions, and top-p implementation details all introduce variance. OpenAI's own documentation states their API is not guaranteed deterministic at temperature 0. For agents, this means integration tests that assert exact output strings will flake intermittently — sometimes passing, sometimes failing on a single word difference. The fix is to test for behavioral equivalence: did the agent call the right tool with the right parameters? Is the JSON structurally valid? These assertions are stable across non-deterministic variance.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:31:36.027883+00:00— report_created — created