Recover an agent connection
Distinguish temporary authorization failures from revoked access without unnecessarily reconnecting an agent.
On this page
A temporary authorization failure does not necessarily mean your agent connection was revoked. The recovery action depends on the token endpoint's HTTP status and OAuth error.
Temporary unavailability
A 503 response with error: "temporarily_unavailable" means the service cannot complete
the authorization check right now. No new credentials are returned. A Retry-After: 5
header asks the client to wait at least five seconds before another attempt.
Keep the current refresh token rather than deleting it solely because of this response. Retry with backoff, and avoid simultaneous refresh attempts. A failed connection check before refresh rotation does not consume a live refresh token; after recovery, it can be used without another sign-in or consent prompt, provided the connection remains authorized.
After a successful refresh, store the new refresh token and stop using the previous one. Do not apply this advice to a token that has already been successfully rotated.
Service errors
A 500 response with error: "server_error" indicates a service-side problem. Repeatedly
signing in or deleting credentials will not repair it. Stop rapid retries and contact support
if the error persists. Share the approximate time, HTTP status and error name, but never
share an access token or refresh token.
Refused access
A 400 response with error: "invalid_grant" is a definitive refusal, not an instruction to
retry indefinitely. The connection may have been revoked, workspace access may have changed,
or the refresh credential may be invalid. Check your access and reconnect through your
agent host when appropriate. To see whether the approval is still active, open Agents and keys
(/agents) in the Console: each approval shows its status as Active, Pending or Revoked. See
Revoke agent access.
Initial connection and lost responses
Authorization codes are single-use. A failure while exchanging a new authorization code does not guarantee that the code can be reused; restarting the connection flow may be necessary. Likewise, a lost network response is not proof that a refresh failed before rotation. Follow your agent host's recovery flow rather than repeatedly replaying an old credential after an uncertain result.
Approval capacity reached
429 with error: "plan_limit_reached" means a new OAuth approval could not reserve
workspace capacity. No authorization code, token or consent grant is issued. Inspect
its plan_refusal facts and keep count and revision strings exact. A person can
revoke an approval in Agents and keys, wait for confirmed pending cleanup or
change plan when an upgrade is available. Increasing an operation budget cannot
create capacity. Do not automatically loop on this refusal: capacity has no calendar
reset and this response has no Retry-After reset.
Pending and cleanup reservations still count until release is confirmed. Retrying
the same verified approval request uses the same intent; starting a fresh connection
flow creates a new request. Refreshing an already admitted approval consumes no new
slot and remains allowed after a plan downgrade. Temporary capacity unavailability,
such as an unavailable capacity check, returns 503 and is not evidence that an
existing approval has been revoked. A brand-new workspace's first approval briefly
waits while the workspace is prepared and normally succeeds on the first attempt.
Approval capacity during consent
When initial consent returns a validated plan_refusal for OAuth approval capacity, the page
keeps your selected workspace and permissions and shows only the bounded known used, held and
limit counts. It stays on consent instead of following an error destination. A capacity refusal
issues no new approval. If reported as available remedies, review an approval you can revoke in
Agents and keys, wait for confirmed cleanup, or ask an owner to review a higher plan in
Billing and usage. Capacity does not renew on a calendar schedule, and management keys are
outside this allowance.
A plan_limits_unavailable response means accounting cannot establish headroom; it is not proof
that the allowance is exhausted. Temporary authorization dependency failures and an expired
consent request have separate explanations. The page does not retry approval automatically, and
does not display arbitrary error prose or links. Server issuance checks enforce capacity; the console displays their refusal. Full issuer-lane
qualification remains separate from these controls.