GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(quota-gatherer): quota ask terminates at the OpenCode server (server-first credential source) by dezren39 · Pull Request #5062 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

What

Drew's ruling (2026-11-03 11:48 CST): "it should ask opencode not meta proxy or anything" — the quota ask must terminate at the OpenCode server (the standing fork server, 127.0.0.1:13420), never at a standalone proxy program and never at a direct credential-store read when the server can answer.

Traced both chains end to end first (evidence in the header comment):

  • Before — Meta: gatherer → in-process OpenChamber quota module → credential from a direct SQLite read of opencode.db (openCodeLocalCredentialSource, deliberately bypassing the server, the old fix(quota-plane): opencode-serve boot verification + quota CLI per-provider resilience (no wholesale transport failure) #1251 posture) → POST https://api.meta.ai/muse-code/key with that credential (falling back to the Muse CLI's own login-store file when the stored minted key is refused). No proxy program and no :187xx hop existed in this chain — but the OpenCode server was never asked anything at all.
  • Before — OpenDesign: gatherer → module → credential from OpenChamber's own managed store (~/.config/openchamber/quota/opendesign.json, a Better Auth session cookie + workspace id) → GET https://amr-api.open-design.ai/api/.... The OpenCode server was not involved in any leg.

The server's quota surface today: the fork server (v2.0.30) exposes no quota/usage endpoint — its route table is credential/session/integration/provider/etc. groups only. The surface it does expose for this is GET /api/credential, which is exactly what the quota CLI's server-backed primary path (#2490) already uses via the module's openCodeCredentialSource.

Change (this PR)

gather-quota.ts now wires the module's credential source server-first, in the quota CLI's exact combined-source shape (commands-quota.js createFallbackCredentialSource, ported — the gatherer does not import CLI plumbing):

  • Primary: openCodeCredentialSource against the standing server — URL + password from ~/.local/state/opencode/service-prod.json (the dispatcher's existing OPENCODE_AUTH_FILE convention), OPENCODE_URL / OPENCODE_SERVER_PASSWORD override, password held in a closure, never logged or placed in a URL.
  • Fallback: openCodeLocalCredentialSource (direct DB read) only on transport failure — a server that answers and refuses stays authoritative. First transport failure switches the tick to the store and logs one provenance line.
  • fix(quota-plane): opencode-serve boot verification + quota CLI per-provider resilience (no wholesale transport failure) #1251 resilience preserved explicitly: server-down degrades to the store read instead of zeroing the tick; if the store also fails, the tick fails loudly via failTick and the previous quota-current.json stands; per-provider perf(quota-plane): parallel provider fetching + per-provider timeout budget for the 15-min tick #1268 last-known retention is untouched. A stale/failed read still never idles a pool.
  • No pool ids or serviceIdFor mappings touched (rebased over the Go-account rename feat(pools): rename Go accounts to owner names — drewrypope (was Personal), popesdrew (new, replaces Lab); remove Home #5057).

Meta after: gatherer → GET /api/credential at the OpenCode server → the module's Meta provider presents that credential to Meta's plan-usage endpoint (the provider's own usage API — the only place that data exists; no proxy anywhere in the chain).

OpenDesign — deliberately NOT rerouted here

Verified live 2026-11-03: the billing/session API the OpenDesign provider answers from accepts only the managed session cookie (200 with it), and refuses the credential the OpenCode server holds for opendesign — the AMR inference API key — with 403 as Bearer and 403 as session cookie. The server also has no credential shape for a (session cookie, workspace id) pair and no quota surface. Rerouting that leg today would lose the read entirely, so it is kept working and the gap is filed precisely as #5060 instead of being silently left in place.

Verification

  • Full aggregator suite on the laptop: 1376 pass, 0 fail; tsc --noEmit shows only the 1 pre-existing baseline error (same on unmodified origin/main).
  • Dry ticks with sandboxed output paths: server-up tick — meta ok, opendesign ok, provider set identical to an old-code tick run minutes apart (no regression); server-down tick (OPENCODE_URL=http://127.0.0.1:9) — fallback log line printed, credentials served from the local store, tick still ok.
  • Post-merge: the systemd user timer picks up the new file automatically (it runs from this checkout); a triggered tick's fresh quota-current.json values are reported on the PR/issue trail.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
feat(quota-gatherer): ask the OpenCode server for credentials, local …
b567fa4
…store only as transport fallback

Drew ruling 2026-11-03: the quota ask terminates at the OpenCode
server (GET /api/credential on the standing fork server, via the
module openCodeCredentialSource — the quota CLI primary path, #2490),
never a standalone proxy and never a direct opencode.db read when
the server can answer. The direct store read remains only as the
transport-failure fallback (CLI combined-source shape), preserving
the #1251 contract: server-down degrades to the store, a failed tick
leaves quota-current.json standing, #1268 retains last-known rows.

OpenDesign is the named exception: its billing API accepts only the
managed session cookie and refuses (403, verified) the inference key
the server holds for opendesign; the server has no quota surface.
Gap filed as #5060.
@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 17:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T17:59:35.598680Z
We couldn’t complete this review. Comment @codex review to try again.
b567fa4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cffdb0db-42ee-4857-a24d-44313842b7c5
Commits

Reviewing files that changed from the base of the PR and between 7de65a8 and b567fa4.

Files selected for processing: 1
  • pm-stack/aggregator/scripts/gather-quota.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit e628bee into main Nov 3, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the quota/server-ask-gatherer branch November 3, 2026 17:59
@dezren39

dezren39 commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Live verification (deployed from merged main, merge commit e628bee): triggered quota-gatherer.service at 12:00 CST. Tick log shows meta ok (511ms) and opendesign ok (645ms) with NO transport-fallback line — credentials were served by the OpenCode server (GET /api/credential, 127.0.0.1:13420). quota-current.json generatedAt 2026-11-03T18:00:14Z: meta 5h 20% / weekly 98%; opendesign 5h 100% (0 / 50000 credits) / 7d 34.43% (98354 / 150000 credits). /api/quota.json (aggregator :4870) carries both pools with the same fresh values. Server-down drill was verified pre-merge with a dead OPENCODE_URL: fallback line logged, local store served, tick ok.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 mentioned this pull request Nov 3, 2026
unify(quota-plane): one quota read path — server endpoint, CLI, and aggregator gatherer must share the direct credential-store read #2490
Open
5 tasks
@developing-today developing-today Bot mentioned this pull request Nov 3, 2026
quota: straight pass-through of the OpenCode quota read (Drew, 2026-11-03) #5080
Merged
This was referenced Nov 3, 2026
quota(opendesign): billing quota ask cannot terminate at the OpenCode server — session-cookie credential the server cannot hold or use #5060
Open
epic(quota-plane): Stage 2 — 15-minute quota gathering in the PM stack, token adapters, automated pool decisions #1149
Open
This was referenced Nov 14, 2026
Retroactive home for PR #5062: feat(quota-gatherer): quota ask terminates at the OpenCode server (server-first credential source) #9876
Closed
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.