{"record":{"id":"a0f4eec5504024d4","repo":"Hmbown/CodeWhale","slug":"codewhale-terminal-receipt-did-not-use-provider-openai","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/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/integrations/verifiers-codewhale/codewhale_harness/harness.py#L210-L246","documentation":"After a successful launch (exit code 0), the harness parses the stream-json terminal receipt and verifies the provider field equals 'openai'. The rollout pins CODEWHALE_PROVIDER/--provider to openai (the Verifiers interception endpoint masquerades as OpenAI), so a different reported provider means the run did not go through the interception path.","triggerScenarios":"The Codewhale binary completed but its terminal receipt reports a provider other than 'openai' — e.g. the binary overrode the provider, ignored the --provider flag, or a mismatched binary/config routed elsewhere.","commonSituations":"Running a stale or modified binary that defaults to another provider; environment leakage (a real OPENAI/other provider key causing re-route); binary/config sha mismatch indicating a non-pinned build.","solutions":["Verify you are running the pinned Codewhale release (check terminal.binary_sha256 in the receipt)","Ensure no environment variables override CODEWHALE_PROVIDER in config.resolved_env","Confirm the harness argv still passes --provider openai and the binary accepts it","Re-install the binary via setup() instead of a custom binary_path"],"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 \"did not use provider openai\" in str(e):\n        # audit binary_sha256/config env for provider overrides before retrying\n        ...\n    else:\n        raise","preventionTips":["Do not set CODEWHALE_PROVIDER or conflicting provider vars in resolved_env","Always run the pinned release via managed setup","Check receipt.provider in trace.info['codewhale'] when debugging"],"tags":["receipt","provider","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"}