feat: price catalog-less provider rows via first-party vendor fallback - #56
Merged
MayankBansal12 merged 7 commits intoSep 11, 2026
Merged
Conversation
Proxy gateways like cliproxy report bare model names under a provider id the catalog does not list, leaving all their usage unpriced. Resolve those rows against a first-party vendor priority list over decorated-name variants (reasoning effort and promo suffixes, full name tried first), then a catalog-wide unique exact match, reporting models-dev-alias with the pricing vendor's id. Providers present in the catalog or pinned rates keep the no-substitution guardrail and still return unknown on a miss. Refs MayankBansal12#55 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Extra Codex accounts exposed as ACP providers keep CODEX_HOME under ~/.codex-profiles/<name>. The host scan now walks each profile's sessions/ tree, tags aggregate rows with the account name, and deduplicates files by inode so a profile aliased to ~/.codex is never counted twice. Server-side, tagged rows become per-account agents (codex-<name>, "Codex (<name>)") so grouping, filters, and breakdowns keep accounts distinct; the dashboard agents list merges discovered agent ids, and codex-* ids reuse the Codex brand mark. Refs MayankBansal12#44 Generated with [Devin](https://devin.ai) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…Bansal12#50) * feat: collect Devin usage from the Devin CLI session database Devin runs in BB through the acp-devin provider and writes no JSONL session logs; usage lives in ~/.local/share/devin/cli/sessions.db. A new serialized host collector opens the WAL database read-only via node:sqlite, extracts only usage metadata fields, deduplicates message nodes by request_id, and emits the shared aggregate-row wire format. Hosts without the database report no-data; an unreadable database or a Node.js too old for node:sqlite surfaces as a Devin-only sync error. Devin records ACU totals rather than per-request USD, so rows carry token counts with unknown pricing. Refs MayankBansal12#45 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat: add the Devin brand mark to provider logos Refs MayankBansal12#45 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve Devin usage on database access errors --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: mayank <mayankbansal125@gmail.com>
…nsal12#51) * feat: collect DeepSeek Harness usage from zstd session logs DeepSeek Harness (the acp-dsh provider) stores sessions at ~/.dsh/sessions/*/*/session.v3.jsonl.zstd: pi-style JSONL appended as concatenated Zstandard frames. Node's zlib decoder stops at the first frame, so the host collector scans frame boundaries structurally and decompresses each frame on its own, with a finish-flush prefix decode for a torn final frame. The dsh parse branch reads assistant/message and assistant/attempt settlements (camelCase usage fields, provider/model from the committed message source or the surrounding request/context), derives the project from the session header cwd, and skips inherited fork history behind the last tagged session/end-seed marker. Discovery is restricted to the canonical v3 generation so retained historical generations are not counted twice. Hosts without Node 22.15+ degrade to the existing per-file failure state; hosts without session logs stay no-data. Refs MayankBansal12#46 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: count DeepSeek attempts once and reject incomplete forks --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: mayank <mayankbansal125@gmail.com>
…2#52) * fix: stage oversized host commands through files.write terminals.create rejects start.command over 10,000 characters, so the serialized JSONL collector commands fail on the host boundary and every JSONL agent reports unavailable. runHostCommand now stages commands that exceed the contract limit into a content-addressed file under ~/.cache/bb-plugin-usage via files.write (whose content is unbounded) and runs it with sh, keeping the held wrapper's DONE marker, exit-code, and __BB_USAGE_ERROR__ semantics identical. Staging failures surface as the real error instead of a doomed inline submission, and every caller of runHostCommand (including the devin collector's devinCommand path) is covered by the same fix. Refs MayankBansal12#47 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: guard staged command reuse and cancelled launches --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: mayank <mayankbansal125@gmail.com>
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
Rows recorded under a provider that isn't in the models.dev catalog at all (e.g.
cliproxy, a local API proxy serving Pi/DSH traffic) returnedunknowneven when the model name is canonical and priced under its first-party vendor. On a real machine this left ~1B tokens — the largest share — unpriced.builtinPrices,resolvePricingnow tries first-party vendors (openai, anthropic, google(-vertex), deepseek, xai, zai/zhipuai, alibaba, meta, kimi-for-coding, moonshotai, mistral, minimax) with the existing model-id variants, then falls back to a unique exact match across the whole catalog.-low/-medium/-high/-xhigh/-max) and promo (-expires-on-*) suffix variants via BFS stripping; the full name is always tried first so real names likeqwen3.8-maxstill win.models-dev-aliasand reattribute the model provider to the pricing vendor — consistent with the existing unknown-provider path.openai+grok-4.6staysunknown), and genuinely unpriced models (swe-*,codex-auto-review) remainunknown.Test plan
openai+ foreign model still unknown;swe-2-maxunknown; effort-suffix resolutionunknowntomodels-dev-alias(+$132 estimated); remainingunknownrows are all genuinely unpriced modelsEvidence
Dashboard after this branch: Pi rows previously "cost unknown" now price via canonical vendors (deepseek-flash $2.11, gemini-3.8-flash $39.00, grok-4.6 $88.27);
swe-2-maxcorrectly stays Unknown.Fixes #55
Generated with Devin