{"record":{"id":"e423f137d0cbe5f9","repo":"Hmbown/CodeWhale","slug":"a-reserved-turn-id-requires-an-operation-key","errorCode":null,"errorMessage":"a reserved turn id requires an operation key","messagePattern":"a reserved turn id requires an operation key","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":9759,"sourceCode":"    async fn start_turn_inner(\n        &self,\n        thread_id: &str,\n        req: StartTurnRequest,\n        reserved_turn_id: Option<&str>,\n    ) -> Result<TurnRecord> {\n        self.start_turn_inner_reporting_replay(thread_id, req, reserved_turn_id)\n            .await\n            .map(|(turn, _replayed)| turn)\n    }\n\n    async fn start_turn_inner_reporting_replay(\n        &self,\n        thread_id: &str,\n        req: StartTurnRequest,\n        reserved_turn_id: Option<&str>,\n    ) -> Result<(TurnRecord, bool)> {\n        if reserved_turn_id.is_some() && req.operation_key.is_none() {\n            bail!(\"a reserved turn id requires an operation key\");\n        }\n        self.start_turn_with_source(\n            thread_id,\n            req,\n            RuntimeTurnInputSource::ExternalUser,\n            reserved_turn_id,\n            false,\n        )\n        .await\n    }\n\n    /// Retry only bytes recovered from validated durable history. This internal\n    /// entry point changes the historical byte ceiling, never model or policy\n    /// admission, and cannot be selected by a network request field.\n    pub(crate) async fn start_turn_from_stored_images(\n        &self,\n        thread_id: &str,\n        req: StartTurnRequest,","sourceCodeStart":9741,"sourceCodeEnd":9777,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/runtime_threads.rs#L9741-L9777","documentation":"start_turn guard: a reserved turn id was supplied without an operation key; reservations exist to support idempotent operation-key replay, so a reservation alone is an invalid combination rejected before any persistence.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:9759 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-empty prompt in the StartTurnRequest.","Use the continuation/goal prompt path (start_goal_turn) if the intent is an automatic continuation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}