{"record":{"id":"a0f4eec5504024d4","repo":"Hmbown/CodeWhale","slug":"codewhale-terminal-receipt-did-not-use-provider-op","errorCode":null,"errorMessage":"Codewhale terminal receipt did not use provider openai","messagePattern":"Codewhale terminal receipt did not use provider openai","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"integrations/verifiers-codewhale/codewhale_harness/harness.py","lineNumber":228,"sourceCode":"            \"--sandbox\",\n            sandbox,\n            \"--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 (","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/integrations/verifiers-codewhale/codewhale_harness/harness.py#L210-L246","documentation":"After a run exits 0, launch() parses the codewhale.exec-stream stdout and asserts the terminal metadata receipt reports provider 'openai'. The harness pins this via CODEWHALE_PROVIDER=openai in the environment and --provider openai on the command line so all model traffic traverses the Verifiers interception endpoint. A missing or different provider value means the run is not attributable to the intercepted endpoint, so the rollout is rejected.","triggerScenarios":"A facade binary ignoring --provider or omitting provider from its terminal metadata; resolved_env overriding CODEWHALE_PROVIDER; stub binaries used for dry-runs that emit schema-conformant events without the provider field.","commonSituations":"Swapping in a mock codewhale for cheap testing; env-merge order changes clobbering harness variables; binary versions that rename the field.","solutions":["Inspect the receipt the harness stores on prior passing runs (trace.info['codewhale']) to see the expected shape","Remove any resolved_env entries that override CODEWHALE_PROVIDER or the OPENAI_* variables the harness sets","Make facades echo provider='openai' in the terminal metadata event","Re-run with the harness-installed binary (drop binary_path) to isolate whether the facade is at fault"],"exampleFix":"# before (facade metadata)\nmeta = {'receipt_kind': 'terminal', 'model': model, 'status': 'completed'}\n# after\nmeta = {'receipt_kind': 'terminal', 'provider': 'openai', 'model': model, 'status': 'completed'}","handlingStrategy":"try-catch","validationCode":"env = dict(harness.config.resolved_env)\nfor key in ('CODEWHALE_PROVIDER', 'OPENAI_BASE_URL', 'OPENAI_API_KEY', 'OPENAI_MODEL'):\n    env.pop(key, None)  # never let resolved_env override harness-owned interception variables","typeGuard":null,"tryCatchPattern":"try:\n    result = await harness.launch(ctx, trace, runtime, endpoint, secret, mcp_urls)\nexcept RuntimeError as e:\n    if 'did not use provider openai' in str(e):\n        mark_rollout_failed(trace, reason='provider_mismatch')  # score 0, keep the run alive\n    raise","preventionTips":["Keep facades schema-conformant with the pinned release's receipt","Never override CODEWHALE_PROVIDER or OPENAI_* in resolved_env","Smoke-test facades with one rollout after every change"],"tags":["receipt","integration","provider","harness"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}