fix(opencode-go): treat 403 EntitlementError as not-subscribed and skip silently - #248
Closed
log0u7 wants to merge 3 commits into
Closed
fix(opencode-go): treat 403 EntitlementError as not-subscribed and skip silently#248log0u7 wants to merge 3 commits into
log0u7 wants to merge 3 commits into
Conversation
added 3 commits
August 28, 2026 13:33
- Detect 403 EntitlementError / subscription-required bodies from the usage API - Cache the API key and short-circuit re-polls until the key changes - QuotaProviderResult gains notApplicable for deliberate no-data outcomes - Renderer skips the Not configured fallback; codec, sanitizer, and clone propagate the flag across persistence and export surfaces - Provider returns notAttempted+notApplicable instead of an error toast
- isQuotaProviderResult whitelists notApplicable and validates its shape - cloneQuotaProviderResult and sanitizeQuotaProviderResult carry the flag so persistence, cache decode, and export paths keep it intact
- Default false: deliberately no-data sources stay fully silent - true: one soft intentional-filter line per no-data provider in the toast and sidebar (does not count as a compact-status issue) - Documented in docs/readme/configuration.md - Scales better than per-provider unavailable rows: N configured sources would otherwise repeat N error rows on every refresh
Contributor
Author
|
The CI runs are still in "action_required" because the PR comes from a fork. |
Contributor
Author
|
Closing as superseded: issue #247 was fixed upstream by @slkiser in #258 (5b3ffaf + 9d6c124), which implements the same behavior (403 EntitlementError -> notSubscribed, credential fingerprint short-circuit, silent skip). The upstream approach is simpler and landed first. Thanks for the quick integration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #247
Summary
A 403
EntitlementErrorfrom the OpenCode Go usage API is a permanent state (the account has no Go subscription), but the plugin kept re-polling it on every refresh and surfaced the raw error in the toast and sidebar indefinitely.This PR treats that response as a first-class "not subscribed" outcome:
lib/opencode-go.ts: detects403+EntitlementError(or a "subscription required" body) and returns anotSubscribedresult with a stable, redaction-safe message.providers/opencode-go.ts: caches the API key on the first not-subscribed response, short-circuits subsequent fetches (no re-poll until the key changes), and returns a not-attempted result carrying anopencode_go_state: not_subscribedstatus detail.QuotaProviderResultgainsnotApplicable: a deliberate no-data outcome that is neither an error nor "not configured". The renderer skips the "Not configured" fallback for it, and the result codec, sanitizer, and clone paths propagate the flag so persistence, cache decode, and exports keep it intact.Why silent by default
With several configured sources, every unavailable or errored provider adds its own row to the toast: N providers mean N recurring error rows on every idle/interrupt refresh. Deliberate no-data states are permanent (they cannot be resolved from the TUI), so repeating them turns the toast into a wall of recurring errors. Silent-by-default keeps the toast limited to actual data; the state remains observable through
statusDetails(/quota statusprobes).Users who want the visibility back can set the new documented option:
{ // one soft intentional-filter line per deliberately no-data provider showNotApplicableProviders: true }Soft lines use the existing
intentional-filterkind, so they do not count as compact-status issues.Testing