{"record":{"id":"e9d71c332aa7d474","repo":"Hmbown/CodeWhale","slug":"operation-key-binding-is-incomplete-retry-after-runtime","errorCode":null,"errorMessage":"operation_key binding is incomplete; retry after Runtime recovery","messagePattern":"operation_key binding is incomplete; retry after Runtime recovery","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":9068,"sourceCode":"        let Some(persisted) = self\n            .store\n            .load_turn_operation_binding(&requested.operation_key_fingerprint)?\n        else {\n            return Ok(None);\n        };\n        if persisted.thread_id != requested.thread_id\n            || persisted.operation_key_fingerprint != requested.operation_key_fingerprint\n            || persisted.request_fingerprint != requested.request_fingerprint\n            || prepared\n                .requested_turn_id\n                .as_deref()\n                .is_some_and(|turn_id| persisted.turn_id != turn_id)\n        {\n            bail!(\"operation_key is already bound to a different turn request\");\n        }\n        let turn_path = self.store.turn_path(&persisted.turn_id)?;\n        if !turn_path.exists() {\n            bail!(\"operation_key binding is incomplete; retry after Runtime recovery\");\n        }\n        let turn = self.store.load_turn(&persisted.turn_id)?;\n        if turn.id != persisted.turn_id || turn.thread_id != persisted.thread_id {\n            bail!(\"operation_key binding does not match its persisted Runtime turn\");\n        }\n        Ok(Some(turn))\n    }\n\n    /// Read the exact durable binding without replaying, recovering, loading an\n    /// engine, or creating even a claim-lock file. The shared claim prevents a\n    /// reader from observing admission records that can still be rolled back.\n    pub(crate) fn lookup_turn_operation(\n        &self,\n        thread_id: &str,\n        operation_key: &str,\n    ) -> Result<Option<TurnRecord>, RuntimeTurnOperationLookupError> {\n        use RuntimeTurnOperationLookupError::{Incomplete, InvalidRequest, Unavailable};\n        validated_record_id(thread_id, \"thread id\").map_err(|_| InvalidRequest)?;","sourceCodeStart":9050,"sourceCodeEnd":9086,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/runtime_threads.rs#L9050-L9086","documentation":"Durability guard in the turn-operation binding check: a persisted binding exists for the operation key fingerprint, but the turn file it points to is missing or incomplete on disk. The binding record and the turn store disagree, which normally means a crash mid-write; Runtime recovery (or replay) is expected to reconcile them.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:9068 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the turn start after Runtime recovery completes and the binding is repaired.","Inspect the turn store for the partially persisted turn and reconcile or remove the stale binding."],"exampleFix":null,"handlingStrategy":"retry","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"}