{"record":{"id":"76e72717430de692","repo":"xai-org/grok-build","slug":"rate-limited-error-code-32003-76e727","errorCode":"RATE_LIMITED_ERROR_CODE (-32003)","errorMessage":"Rate limited","messagePattern":"Rate limited","errorType":"exception","errorClass":"acp::Error","httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-shell/src/session/acp_session_impl/sampler_turn.rs","lineNumber":1270,"sourceCode":"                    error_type: \"encrypted_content_mismatch\".to_string(),\n                    message: friendly.clone(),\n                },\n            ))\n            .await;\n            return Err(acp::Error::invalid_params().data(friendly));\n        }\n\n        if matches!(error.kind, SamplingErrorKind::RateLimited) {\n            self.log_terminal_failure(\"rate_limited\", error.status_code, &detailed_message);\n            self.send_xai_notification(XaiSessionUpdate::RetryState(\n                crate::extensions::notification::RetryState::Exhausted {\n                    attempts: rate_limit_waits,\n                    reason: detailed_message.clone(),\n                    is_rate_limited: true,\n                },\n            ))\n            .await;\n            let acp_err = acp::Error::new(\n                crate::sampling::error::RATE_LIMITED_ERROR_CODE,\n                \"Rate limited\".to_string(),\n            )\n            .data(detailed_message);\n            return Err(acp_err);\n        }\n\n        // 4. Auth-401 recovery only applies to refreshable session-token auth (the\n        //    stable gate, not `creds.auth_type`): a static api-key isn't refreshable,\n        //    so retrying re-sends the same rejected bearer and 401-loops the turn.\n        //    See `crate::agent::auth_method::session_token_auth_gate`.\n        // One sampling-config snapshot drives every arm-4 decision, so the\n        // provider resolution and the gate can't disagree mid-model-switch.\n        let (failed_model_id, failed_base_url) = self\n            .chat_state_handle\n            .get_sampling_config()\n            .await\n            .map(|c| (c.model, c.base_url))","sourceCodeStart":1252,"sourceCodeEnd":1288,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-shell/src/session/acp_session_impl/sampler_turn.rs#L1252-L1288","documentation":"Error \"Rate limited\" thrown in xai-org/grok-build.","triggerScenarios":"Thrown at crates/codegen/xai-grok-shell/src/session/acp_session_impl/sampler_turn.rs:1270 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}