Repository navigation
fix(usage): price Magpie model ids and read Magpie limits - #141
Conversation
Magpie prefixes model ids with the harness (`codex/gpt-6.1-sol`, `claude/...`, `grok/...`), so rate lookup missed the table and reported them unpriced. A harness prefix now prices at the bare model's rate when that rate is unambiguous. OpenCode instances Magpie routes to another provider no longer probe OpenCode Go, which answered with a read error. Magpie's grok accounts map onto the Grok limits pool, and `grok/grok-4.7` running as `grok-4.7-build` is no longer flagged as a model substitution. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
{"reviewed_head": "306ddbe89f378ac90647dae115ec9e158c262212", "reviewer": "grok-4.7, Claude Code review lane", "findings": []}Review: CLEANIndependent review of the Magpie usage reporting fix (CLO-951) at Checked against the four reported bugs:
Not verified: the ARC CI check was still running, and nothing was exercised against a live Magpie gateway. |
Deploy: fleet
Problem and change
Kameron's usage panel (2026-11-20) showed three Magpie reporting bugs, tracked on the usage panel issue (CLO-951, https://linear.app/closura/issue/CLO-951/usage-panel-remove-stale-opencode-instances-explain-agy).
codex/gpt-6.1-sol(andclaude/...,grok/...) reported "no known rates" while the bare id was priced. Magpie prefixes the model id with the harness, which is not a rate-table provider. Rate lookup now prices acodex/,claude/orgrok/prefix at the bare model's rate when that rate is unambiguous, and leaves a genuinely ambiguous name unpriced.OPENCODE_FLAGSroutes to another provider now reports that it routes through a custom model provider instead of probing. Codex already skips its JSON-RPC usage read on a confirmed custom route.grokaccounts never joined Limits → Grok. They now map onto the Grok driver with thesubscriptionwindow id the native Grok probe uses, so both shared accounts show beside direct Grok accounts.Also,
model_substitutedno longer fires when Magpie selectsgrok/grok-4.7and xAI runsgrok-4.7-build. A rate-table provider prefix such asopenai/is still a substitution.The open usage-panel PR (#124) only drops dead OpenCode Go keys and names the Antigravity window, so this is separate.
Evidence
pnpm --filter t3 exec vp test run src/usage/usagePricing.test.ts src/usage/magpieQuotas.test.ts src/orchestration-v2/SubagentProjection.test.ts: 56 passed, then 27 passed after the prefix narrowing.pnpm --filter @t3tools/provider-opencode exec vp test run src/server/status.test.ts: 41 passed.pnpm --filter t3 typecheck,@t3tools/provider-opencodeand@t3tools/provider-coretypecheck: exit 0.Human review: not requested
🤖 Generated with Claude Code