Repository navigation
feat(usage): count Devin history from its local sessions database - #29631
piotrnowakowski wants to merge 3 commits into
Conversation
Devin runs through the ACP Registry driver, which had no usage reader, so Devin turns never appeared in Usage. Read the Devin CLI's sessions.db, dedupe inferences stored on several message nodes by request id, and price the base model with Devin's effort and fast-mode suffixes stripped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Devin history is automatically included in Usage when its local database exists, changing displayed totals and adding API-rate cost estimates rather than actual ACU charges. Human review is needed to confirm this default inclusion and cost presentation. You can add or adjust custom eligibility rules. Learn more. |
|
Both points follow how the other usage sources already work, and the maintainer decision is open in #27535:
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Read Devin usage from session databases packages/provider-acp-registry/src/server/devinUsage.ts, packages/provider-acp-registry/src/server/devinUsage.test.ts |
The reader resolves session directories, parses assistant-message metadata, filters and deduplicates records, and reports missing databases or read errors. Tests cover parsed records, duplicate request IDs, time-window filtering, missing databases, and registry-instance selection. |
Connect the reader to the provider packages/contracts/src/usage.ts, packages/provider-acp-registry/src/server/driver.ts, apps/server/src/provider/builtInDrivers.ts |
The usage contract accepts devin. The ACP registry driver provides the Devin reader and declares its environment requirements. The built-in driver list includes the ACP registry driver. |
Present and document Devin usage apps/mobile/src/features/usage/usageProviders.ts, apps/web/src/components/usage/usageProviders.ts, apps/web/src/components/usage/UsageProviderChart.test.ts, docs/user/usage.md |
Mobile and web usage-provider configuration includes Devin. The chart test expects a Devin band. The documentation describes Devin’s session database, directory override, estimated costs, and filter value. It also lists Muse Code as a usage history source. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant devinUsageReader
participant FileSystem
participant sessionsDb as sessions.db
devinUsageReader->>FileSystem: Resolve and check database path
devinUsageReader->>sessionsDb: Query assistant messages
sessionsDb-->>devinUsageReader: Return message rows
devinUsageReader->>devinUsageReader: Parse and deduplicate usage records
Possibly related issues
- pingdotgg/t3code#20246: This change deduplicates Devin records by request ID, which may intersect with the issue’s concern about undercounting from deduplication, although the issue describes a different provider and identical-metric records.
Suggested reviewers: maria-rcks
Merge Risk: 
Minimal · up to f6175
-
The prior cross-platform test risk is fixed, and no confirmed merge-blocking issue remains.
Pre-merge checks: 
3 · 
1
-
Failed checks: 1 warning Passed checks: 3 passedFull details: Description check
-
Explanation
The description explains the implementation, validation, screenshots, and known limitations, but it does not follow the required section structure. It also states that the linked Ideas discussion has no maintainer approval and does not provide an approval exemption.
Resolution
Organize the description under Problem, Change, Scope and approval, and Verification headings. Add the problem and expected behavior, provide maintainer approval or explain why this focused change qualifies without prior approval, and retain the focused validation results and unchecked platform details.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The ACP Registry driver serves every ACP agent, so a Kimi-only setup also scanned Devin's sessions.db. Skip instances that are not the registry's devin agent, and add Devin's band to the provider chart test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Nice, this pairs well with realhasanshoaib#1 (stacked on #26381), which fills the Limits side with Devin's daily and weekly allowance from the CLI's |
|
Thanks @piotrnowakowski for the earlier Devin history work and tests. Closing this in favor of #30248 by @screen-gd, which also reads and deduplicates Devin session history and has newer work and broader verification. This branch has not been updated since November 2, and main has changed the affected files since then. The |
Devin sessions now show up on the Usage page alongside the other providers.
devinusage source on the ACP Registry driver. For each registry Devin instance, it reads the Devin CLI'ssessions.dbread-only ($DEVIN_SESSIONS_DIR, else$XDG_DATA_HOME/devin/cli). Other ACP agents and local commands are skipped.request_id.claude-opus-5-5-high-fastis priced asclaude-opus-5-5at the fast tier. Devin bills in ACUs, so cost is the API-rate estimate.docs/user/usage.md.Proposed in Ideas discussion #27535, which has no maintainer approval yet. Limits stay out of scope; #26381 covers them.
Validation: the new
devinUsage.test.tscovers dedupe, the time window, model mapping, a missing database, and instance filtering.vp run check:changedpasses. On a copy of a real Devin 3000.11.234 database, 80 assistant nodes became 40 records ($2.79 estimate). The screenshots below are fromvp run devwith the same home data, onmainand on this branch.Not checked: macOS and Windows paths, and Devin's newer files-based session store, which this build can migrate to.
Written by Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code