You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ACP: map structured provider HTTP 401/403 errors to AuthRequiredError #48297
With OpenCode 1.18.30 in ACP mode, an OpenAI-compatible provider can return a structured APIError with data.statusCode 401 or 403. packages/opencode/src/acp/service.ts only maps ProviderAuthError to ACP AuthRequiredError, so this case is emitted as a generic JSON-RPC -32603 / service failure. ACP clients consequently cannot distinguish an expired or invalid credential from a backend failure.
Expected behavior: classify structured APIError.data.statusCode values 401 and 403 as AuthRequiredError. Please keep the check structured: message text and provider response bodies should not be parsed or forwarded, and 429/unknown errors should remain non-auth failures.
OpenCode version
1.18.30
Steps to reproduce
Configure an OpenAI-compatible provider with an invalid API key.
Start opencode acp and initialize an ACP session.
Send a prompt that reaches the provider.
Observe the provider's structured 401 error becoming generic -32603 rather than an ACP authentication-required error.
hey! this should be fixed in v2 now 🙏 if you're still on 1.x, upgrading to v2 should sort it out. let us know if you still hit it after upgrading and we'll take another look!
Fixed on v2. Core classifies provider 401 and 403 responses as authentication failures, and the ACP agent returns ACP's auth_required error (-32000) for them, while rate limits stay internal errors. Please reopen if an invalid key still gives -32603 on v2.
Activity
nexxeln commentedon Oct 1, 2026
hey! this should be fixed in v2 now 🙏 if you're still on 1.x, upgrading to v2 should sort it out. let us know if you still hit it after upgrading and we'll take another look!
nexxeln commentedon Oct 6, 2026
Fixed on v2. Core classifies provider 401 and 403 responses as authentication failures, and the ACP agent returns ACP's auth_required error (-32000) for them, while rate limits stay internal errors. Please reopen if an invalid key still gives -32603 on v2.