Repository navigation
fix(usage): every host reads the fleet's Magpie gateway, not only the ones its configs name (CLO-1348) - #248
Merged
nullStack65 merged 2 commits intoNov 29, 2026
Conversation
… ones its configs name (CLO-1348) Usage limit discovery found a Magpie gateway only from a private base URL named in an enabled instance's own config (Codex config.toml, OpenCode config, Claude settings). A host that signs in natively names none, so its Usage panel listed a different set of quota accounts than a host routed through the gateway, even though the fleet reads one source: the ASUS gateway's /v1/magpie/quotas, over the loopback link on 127.0.0.1:13425 (127.0.0.1:3425 on ASUS). Discovery now also tries those two loopback origins after the ones the configs name. They answer the quotas route without a key and a closed port is dropped quietly. An account set a configured or discovered source already shows is not listed twice. T3CODE_MAGPIE_FLEET_GATEWAYS=off restores config-only discovery. Scope: this is the quota-row half of CLO-1348. Token totals, billed cost and the per-target live comparison stay open on the issue. Model: claude-sonnet-5-5 Task: fix Agent: Platform Lane: CLO-1348 Harness: t3/claude-code Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…O-1348) Review finding: refreshLive built its sources from route-named origins only, so a host reaching the fleet gateway only through loopback lost the row on a manual refresh. Read those origins without the live POST. Model: claude-sonnet-5-5 Task: fix Agent: Platform Lane: CLO-1348 Harness: t3/claude-code Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
nullStack65
force-pushed
the
feat/clo-1348-usage-fleet-parity
branch
from
November 29, 2026 16:41
5a686c7 to
b1b490b
Compare
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.
Problem
CLO-1348: T3 Usage should show the same Magpie-backed data on every fleet machine. Quota-row discovery found a Magpie gateway only from a private base URL named in an enabled instance's own config (Codex
config.toml, OpenCode config, Claude settings). A host that signs in natively names none, so its panel listed different quota accounts than a host routed through the gateway, although the fleet reads one source: the ASUS gateway's/v1/magpie/quotas, over the loopback link127.0.0.1:13425(127.0.0.1:3425on ASUS itself; seescripts/magpie_quota.pyanddocs/infra/subscriptions.mdin Home).Change
discoverGatewayOriginsnow appends the two fleet loopback origins after the ones the configs name. A closed port is dropped quietly, an account set already shown by a configured or discovered source is not listed twice (existing dedupe), andT3CODE_MAGPIE_FLEET_GATEWAYS=offrestores config-only discovery. No new settings key, no credential, no schema change: older peers are unaffected because this is read-side only.Scope
This PR is the quota-row half of CLO-1348 only. It does not close the issue. Still open on it:
claudex2,grokx2,codexx1 and onemagpie-openrouter-freebalance card. It carriesbalance,last,lastServedAtandresetsfields the reader's schema ignores, and it returned no OpenCode or Antigravity/Gemini quota row. Thebalancecard has no driver mapping and is dropped silently, so the panel cannot yet say "provider-limited" for it.Prior art
Searched: 2026-11-29, nullStack65/t3code and Home repo for existing fleet quota readers.
scripts/magpie_quota.py(closura-quota): reuses its source and ports. Verdict: same source, different consumer.usageLimitSources: rejected. A persisted{}hides a decoding default, and a key would have to ship in config.Verification
pnpm exec vp test run src/usageinapps/server: 9 files, 245 tests pass. New tests: discovery returns the fleet origins for a host whose instances name no gateway (and dedupes when they do), andUsageLimitSourcesshows a Magpie source from the loopback link with the other port refusing.effect-tsgo tsrs --noEmitinapps/server: no errors.vp fmtclean on the 3 changed files.vp lint(the local Node 22 cannot load the oxlint TypeScript plugin here, so CI is the lint check); no live UI check yet.127.0.0.1:13425/v1/magpie/quotasanswered 200 with 6 cards;127.0.0.1:3425refused, as expected off ASUS.Deploy: fleet
Model: claude-sonnet-5-5, harness t3/claude-code.
🤖 Generated with Claude Code