Repository navigation
fix(opencode): accept the nested usage envelope - #104
Merged
Merged
Conversation
GET /zen/go/v1/usage returns usage.rolling.percent with an absolute resetsAt, not the flat rollingUsage.usagePercent with a relative resetInSec the adapter validated. Every response therefore failed validation and the card degraded to the authenticated-only /models check, hiding all three quota windows. Both shapes are now accepted, so an older deployment is unchanged. Signed-off-by: Álvaro Tejero Cantero <[email protected]>
…lope The nested /zen/go/v1/usage envelope can omit resetsAt or send an empty string. Cover that case, fractional percentages, a rate-limited window, useBalance in the nested shape and an out-of-range nested percentage, so each degrades the way the flat envelope already did. docs/providers.md still described only the flat rollingUsage/resetInSec shape; it now names the nested shape first and the flat one as the legacy form the adapter keeps parsing. Signed-off-by: Bernardo Pinto Gomes <[email protected]>
Signed-off-by: Bernardo Pinto Gomes <[email protected]>
7 of 10 tasks
This was referenced Nov 8, 2026
5 of 10 tasks
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.
Summary
Supersedes #103 and keeps its commit by @alvorithm unchanged, with one follow-up commit on top.
/zen/go/v1/usagenow answers with a nested envelope,usage.{rolling,weekly,monthly}.{status,percent,resetsAt}, wherepercentis the used share andresetsAtis an absolute ISO 8601 time. The adapter only validated the old flatrollingUsage/resetInSecshape, so every response failed validation. The card then fell back to "Authenticated, quota endpoint unavailable" and none of the three windows from #22 appeared.resetInSecto an absolute time.resetsAt, or an empty one, keeps its percentage with a null reset instead of an invented one.rate-limitedwindow,useBalancein the nested shape and an out-of-range nested percentage, which degrades to auth-only like the flat shape.docs/providers.mddescribed only the flat shape. It now names the nested shape first and the flat one as legacy.Other clients that read this endpoint report the same shape change.
Related issues
Supersedes #103.
Type of change
Checklist
plugin.json.versionandCHANGELOG.mdare consistent (not release-bearing;## Unreleasedbullet)i18n/en.jsonkeys have translations in every locale (no new strings)git commit -s) under the DCOLocal gates:
check-metadata,check-changelog,check-dco,bash -n,shellcheck -S warning,qmllint,actionlint,gitleaks, everytests/test-*.sh(including the native widget runtime on Wayland), andAIOC_COVERAGE_MIN=95 scripts/coverage.