Hmbown/CodeWhale · error

reserved Runtime turn id does not match the durable…

Error message

reserved Runtime turn id does not match the durable operation binding

What it means

start_turn_with_reserved_id postcondition: the turn created under the reserved id came back with a different id, meaning the runtime did not honor the reservation; the mismatch fails loudly because the reserved id and the durable operation binding would otherwise diverge.

Solutions

  1. Retry the turn without a reserved id, or with a reserved id derived from the same operation binding.
  2. Ensure the caller passes a reserved id only alongside the operation key that produced it.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/runtime_threads.rs:9736 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/4f233c4e2c1a84a9. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/runtime_threads.rs:9736

        thread_id: &str,
        req: StartTurnRequest,
    ) -> Result<(TurnRecord, bool)> {
        self.start_turn_inner_reporting_replay(thread_id, req, None)
            .await
    }

    pub(crate) async fn start_turn_with_reserved_id(
        &self,
        thread_id: &str,
        req: StartTurnRequest,
        reserved_turn_id: &str,
    ) -> Result<TurnRecord> {
        validated_record_id(reserved_turn_id, "reserved turn id")?;
        let turn = self
            .start_turn_inner(thread_id, req, Some(reserved_turn_id))
            .await?;
        if turn.id != reserved_turn_id {
            bail!("reserved Runtime turn id does not match the durable operation binding");
        }
        Ok(turn)
    }

    async fn start_turn_inner(
        &self,
        thread_id: &str,
        req: StartTurnRequest,
        reserved_turn_id: Option<&str>,
    ) -> Result<TurnRecord> {
        self.start_turn_inner_reporting_replay(thread_id, req, reserved_turn_id)
            .await
            .map(|(turn, _replayed)| turn)
    }

    async fn start_turn_inner_reporting_replay(
        &self,
        thread_id: &str,

View on GitHub (pinned to 73e0f67d83)