{"record":{"id":"945289a603679330","repo":"Hmbown/CodeWhale","slug":"codewhale-terminal-receipt-model-did-not-match-rollout","errorCode":null,"errorMessage":"Codewhale terminal receipt model did not match rollout","messagePattern":"Codewhale terminal receipt model did not match rollout","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"integrations/verifiers-codewhale/codewhale_harness/harness.py","lineNumber":230,"sourceCode":"            \"--output-format\",\n            \"stream-json\",\n        ]\n        if self.config.max_turns is not None:\n            argv.extend([\"--max-turns\", str(self.config.max_turns)])\n        if self.config.disabled_tools:\n            argv.extend([\"--disallowed-tools\", \",\".join(self.config.disabled_tools)])\n        if system:\n            argv.extend([\"--append-system-prompt\", system])\n        argv.extend([\"--\", str(prompt or \"\")])\n\n        result = await runtime.run_program(argv, env)\n        if result.exit_code == 0:\n            receipt = _parse_stream_receipt(result.stdout)\n            terminal = receipt[\"terminal\"]\n            if terminal.get(\"provider\") != \"openai\":\n                raise RuntimeError(\"Codewhale terminal receipt did not use provider openai\")\n            if terminal.get(\"model\") != ctx.model:\n                raise RuntimeError(\"Codewhale terminal receipt model did not match rollout\")\n            if terminal.get(\"approval_posture\") != \"auto_tools\":\n                raise RuntimeError(\"Codewhale terminal receipt did not confirm auto tools\")\n            if terminal.get(\"sandbox_posture\") != sandbox:\n                raise RuntimeError(\"Codewhale terminal receipt sandbox did not match launch\")\n            if receipt[\"events\"].get(\"error\", 0) != 0:\n                raise RuntimeError(\"Codewhale successful run contained an error event\")\n            if terminal.get(\"status\") != \"completed\":\n                raise RuntimeError(\"Codewhale terminal receipt did not report completion\")\n            if terminal.get(\"termination_reason\") != \"resolved\":\n                raise RuntimeError(\"Codewhale terminal receipt was not resolved\")\n            trace.info[\"codewhale\"] = receipt\n        return result\n\n\ndef _has_version(output: str, version: str) -> bool:\n    return (\n        re.search(\n            rf\"(?<![0-9A-Za-z.+-]){re.escape(version)}(?![0-9A-Za-z.+-])\",","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/integrations/verifiers-codewhale/codewhale_harness/harness.py#L212-L248","documentation":"Post-run receipt validation requires terminal.model to equal ctx.model — the model name the rollout requested via OPENAI_MODEL/CODEWHALE_MODEL and the --model argv flag. A mismatch means the binary ran a different model than the evaluation rollout expects, invalidating the trace.","triggerScenarios":"The binary ignores --model, normalizes the model name differently (e.g. aliases or adds a prefix), or a stale env value overrides the model so the receipt reports a name differing from ctx.model during launch().","commonSituations":"Model aliasing in the local binary's config; ctx.model changed between request construction and launch; a custom binary_path whose config hardcodes a model; case/format differences like 'gpt-4o-mini' vs 'openai/gpt-4o-mini'.","solutions":["Compare terminal.model in the receipt with ctx.model and align them exactly (string-equal)","Remove any CODEWHALE_MODEL/OPENAI_MODEL overrides in config.resolved_env that differ from ctx.model","Use the pinned binary (drop custom binary_path) so model forwarding matches the harness contract"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = await harness.launch(ctx, trace, runtime, endpoint, secret, mcp_urls)\nexcept RuntimeError as e:\n    if \"model did not match rollout\" in str(e):\n        # compare receipt terminal.model with ctx.model and fix overrides\n        ...\n    else:\n        raise","preventionTips":["Avoid CODEWHALE_MODEL/OPENAI_MODEL overrides that diverge from ctx.model","Use exact model names without aliases or vendor prefixes","Confirm any custom binary forwards --model verbatim"],"tags":["receipt","model","verification"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}