{"record":{"id":"3cea234908129c6c","repo":"openai/codex","slug":"32600","errorCode":"-32600","errorMessage":"thread must be idle before starting a goal: {thread_id}","messagePattern":"thread must be idle before starting a goal: (.+?)","errorType":"exception","errorClass":"InvalidRequestError","httpStatus":null,"severity":"error","filePath":"sdk/python/src/openai_codex/client.py","lineNumber":567,"sourceCode":"            pass\n\n    def start_goal_operation(\n        self,\n        thread_id: str,\n        objective: str,\n    ) -> tuple[_GoalOperationState, str]:\n        \"\"\"Start a logical goal and wait for its runtime-generated first turn.\"\"\"\n        with self._thread_start_lock(thread_id):\n            return self._start_goal_operation(thread_id, objective)\n\n    def _start_goal_operation(\n        self,\n        thread_id: str,\n        objective: str,\n    ) -> tuple[_GoalOperationState, str]:\n        thread = self.thread_read(thread_id).thread\n        if not isinstance(thread.status.root, IdleThreadStatus):\n            raise InvalidRequestError(\n                -32600,\n                f\"thread must be idle before starting a goal: {thread_id}\",\n            )\n        if thread.ephemeral or thread.path is None:\n            raise InvalidRequestError(\n                -32600,\n                f\"thread must be persisted before starting a goal: {thread_id}\",\n            )\n\n        state = self.reserve_goal_operation(thread_id)\n        activated = False\n        try:\n            self.thread_goal_clear(thread_id)\n            state.activate_turn_routing()\n            self.thread_goal_set(\n                thread_id,\n                objective=objective,\n                status=ThreadGoalStatus.active,","sourceCodeStart":549,"sourceCodeEnd":585,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/python/src/openai_codex/client.py#L549-L585","documentation":"Error \"thread must be idle before starting a goal: {thread_id}\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/python/src/openai_codex/client.py:567 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the thread current turn to complete before starting a goal on it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}