{"record":{"id":"28c31549d8335aff","repo":"Hmbown/CodeWhale","slug":"codewhale-terminal-receipt-did-not-report-completi","errorCode":null,"errorMessage":"Codewhale terminal receipt did not report completion","messagePattern":"Codewhale terminal receipt did not report completion","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"integrations/verifiers-codewhale/codewhale_harness/harness.py","lineNumber":238,"sourceCode":"            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.+-])\",\n            output,\n        )\n        is not None\n    )\n\n\ndef _bounded_terminal(meta: dict[str, Any]) -> dict[str, Any]:\n    terminal: dict[str, Any] = {}","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/integrations/verifiers-codewhale/codewhale_harness/harness.py#L220-L256","documentation":"The terminal receipt's status must be 'completed'. An exit code of 0 with any other status means the binary considers the run finished some other way (aborted, cancelled) while still exiting cleanly, so the harness refuses to score it.","triggerScenarios":"Gracefully handled interrupts mapped to exit 0; facades emitting status='ok' or omitting the field; signals swallowed by wrapper scripts so the binary exits cleanly without completing.","commonSituations":"Orchestration layers cancelling rollouts on timeout; facades with status vocabularies copied from other tools; wrappers converting non-zero exits.","solutions":["Let rollouts finish naturally; avoid interrupting or wrapping exits","Emit status='completed' from facade terminal metadata","Inspect the raw stream-json stdout to see which status the binary actually reported"],"exampleFix":"# before (facade)\nmeta = {'status': 'ok'}\n# after\nmeta = {'status': 'completed'}","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 report completion' in str(e):\n        inspect_raw_stdout_for('status')  # see what the binary actually reported\n    raise","preventionTips":["Do not cancel or wrap rollout exits in orchestrators","Keep the facade status vocabulary exactly 'completed'","Preserve non-zero exits for abnormal endings so they fail earlier"],"tags":["receipt","integration","status","harness"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}