BloopAI/vibe-kanban · error

request_id called for unsupported request variant

Error message

request_id called for unsupported request variant

What it means

The codex AppServerClient's request_id helper extracts the request id from a ClientRequest via a match. The listed variants all carry a request_id; the catch-all arm hits `unreachable!("request_id called for unsupported request variant")`. This panic means the function was called with a ClientRequest variant that has no request_id field (e.g. notifications or fire-and-forget requests), which its callers (send_request, spawn_turn_start) should never construct.

Source

Thrown at crates/executors/src/executors/codex/client.rs:978

        answers: codex_answers,
    }
}

fn request_id(request: &ClientRequest) -> RequestId {
    match request {
        ClientRequest::Initialize { request_id, .. }
        | ClientRequest::ThreadStart { request_id, .. }
        | ClientRequest::ThreadFork { request_id, .. }
        | ClientRequest::TurnStart { request_id, .. }
        | ClientRequest::GetAccount { request_id, .. }
        | ClientRequest::ReviewStart { request_id, .. }
        | ClientRequest::McpServerStatusList { request_id, .. }
        | ClientRequest::ThreadCompactStart { request_id, .. }
        | ClientRequest::ThreadRead { request_id, .. }
        | ClientRequest::ConfigRead { request_id, .. }
        | ClientRequest::ConfigBatchWrite { request_id, .. }
        | ClientRequest::GetAccountRateLimits { request_id, .. } => request_id.clone(),
        _ => unreachable!("request_id called for unsupported request variant"),
    }
}

#[derive(Clone)]
pub struct LogWriter {
    writer: Arc<Mutex<BufWriter<Box<dyn AsyncWrite + Send + Unpin>>>>,
}

impl LogWriter {
    pub fn new(writer: impl AsyncWrite + Send + Unpin + 'static) -> Self {
        Self {
            writer: Arc::new(Mutex::new(BufWriter::new(Box::new(writer)))),
        }
    }

    pub async fn log_raw(&self, raw: &str) -> Result<(), ExecutorError> {
        let mut guard = self.writer.lock().await;
        guard

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Identify the offending variant from the panic backtrace and add it to the match arm list in request_id (if it carries a request_id).
  2. If the variant legitimately has no request id, do not route it through send_request; handle it as a notification.
  3. Pin/adjust the codex-app-server-protocol dependency so variants match the code, then update the match for any new versions.

Example fix

// before
_ => unreachable!("request_id called for unsupported request variant"),
// after
ClientRequest::NewVariant { request_id, .. } => request_id.clone(),
_ => unreachable!("request_id called for unsupported request variant"),
Defensive patterns

Strategy: type-guard

Validate before calling

// Only call for request variants known to carry request_id
fn has_request_id(req: &ClientRequest) -> bool {
  matches!(req, ClientRequest::ThreadRead {..} | ClientRequest::ConfigRead {..} /* ... */)
}

Prevention

When it happens

Trigger: Calling request_id() with a ClientRequest variant not in the explicit match list — e.g. a variant added in a newer codex-app-server-protocol version, or a notification-style variant that carries no request_id.

Common situations: Upgrading the codex protocol crate adds new ClientRequest variants while request_id's match isn't updated; a refactor routes a new request type through send_request without teaching request_id about it.

Related errors


AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29). Data as JSON: /api/errors/d6e0bd91d44db228. Report an issue: GitHub.