feat: add sub-agent cost breakdown with recursive session walker - #13588
feat: add sub-agent cost breakdown with recursive session walker#13588JudicaelPoumay wants to merge 18 commits into
Conversation
…alker Adds a costs() utility that recursively walks sub-agent sessions to compute own vs total cost. Updates UI/TUI to display the breakdown. Fixes anomalyco#11027
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
There was a problem hiding this comment.
This change seems unrelated. Is this related?
There was a problem hiding this comment.
No, this is a draft PR. Mostly vibe coded so far, so there a lot of AI garbage still. Had to push to work on another computer.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
This reverts commit bc26330.
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Summary
Add sub-agent cost breakdown with recursive session walker
Add recursive costs() utility for sub-agent expenditure tracking
The cost of the session/agents now includes the cost of subagents.
This recursively applies when inspecting sub-agents.
Subagents cost is visible in the chat
Comprehensive test coverage (13 new tests)
Visual changes
When inside an agent, display the total cost of that agent and its sub-agents.
Similar changes for the Web app
Verification
Passed packages/util/src/cost.test.ts (7 tests)
Passed packages/app/src/components/session/session-context-metrics.test.ts (6 tests)
Typecheck passes for all affected packages (@opencode-ai/ui, @opencode-ai/util, @opencode-ai/app, opencode)
Note: @opencode-ai/enterprise typecheck failure is pre-existing on dev (unrelated custom-elements.d.ts issue)