{"record":{"id":"3f8e50107a6f6d40","repo":"openai/codex","slug":"the-connected-codex-runtime-did-not-activate-goal","errorCode":null,"errorMessage":"the connected Codex runtime did not activate goal mode for this turn","messagePattern":"the connected Codex runtime did not activate goal mode for this turn","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdk/python/src/openai_codex/_goal.py","lineNumber":290,"sourceCode":"\n        if isinstance(payload, TurnCompletedNotification):\n            self.active = False\n            self.last_completed = payload\n            if payload.turn.status == TurnStatus.interrupted:\n                return [\n                    self._completion(\n                        notification.method,\n                        self.failed_completion or payload,\n                    )\n                ], True\n            if payload.turn.status == TurnStatus.failed:\n                self.failed_completion = payload\n                if self.cleared or _terminal_goal_status(self.status):\n                    self.state.finish()\n                    return [self._completion(notification.method, payload)], True\n                return [], False\n            if self.status is None and not self.cleared:\n                raise RuntimeError(\n                    \"the connected Codex runtime did not activate goal mode for this turn\"\n                )\n            if self.cleared or _terminal_goal_status(self.status):\n                self.state.finish()\n                return [\n                    self._completion(\n                        notification.method,\n                        self.failed_completion or payload,\n                    )\n                ], True\n            return [], False\n\n        events = [_logical_notification(notification, logical_turn_id)]\n        if isinstance(payload, ThreadGoalUpdatedNotification):\n            self.status = payload.goal.status\n            if self.status == ThreadGoalStatus.active:\n                self.cleared = False\n            events = []","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/python/src/openai_codex/_goal.py#L272-L308","documentation":"The goal-mode watcher saw the turn complete without the runtime ever signaling that goal mode was activated for it (the activation flag stayed false through TurnCompletedNotification). This means the connected Codex runtime ignored or did not support the goal request, so the SDK cannot attribute the turn to the goal.","triggerScenarios":"Thrown at sdk/python/src/openai_codex/_goal.py:290 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start the goal through the SDK goal API against a runtime version that supports goal mode; ensure the turn was created as a goal turn."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}