| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Subagent (Task tool) calls run in separate child sessions, so their LLM spend was previously invisible from the parent. The sidebar showed only the parent session's own cost, and the history task block had no cost line at all. Add `Session.cost(sessionID)` that BFS-walks descendants and sums assistant message cost across the subtree, exposed via a new `GET /session/:id/cost` route (Hono + HttpApi parity). The TUI sync caches the rollup and invalidates it on `message.updated` for any completed assistant message, so subagent completions propagate to ancestor sidebars without tracking parent_id chains client-side. Sidebar now renders `$X.XX ($Y.YY subagents) spent` when subagents exist, and the completed Task tool footer in the message stream gains a `· $X.XX` suffix showing that subagent task's total spend (its own plus its own descendants).
|
The following comment was made by an LLM, it may be inaccurate: ResultsPotentially Related PR:
This PR (25712) appears to be the only one specifically addressing subagent cost rollup display in the sidebar and task history. |
Sorry, something went wrong.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Sorry, something went wrong.
|
This is a solid PR and much needed as subagent spending is currently effectively invisible. |
Sorry, something went wrong.
|
The status bar (prompt/index.tsx:351) and subagent footer (subagent-footer.tsx:45) still read session.cost directly, showing only the current session's cost instead of the aggregated total. Was this intentional or an oversight? Happy to follow up with a PR if needed. |
Sorry, something went wrong.
|
Any progress on this 👀 would love to get that info without having to check my billing section to get the info summarized... |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Subagent (Task tool) calls run in separate child sessions, so their LLM spend was previously invisible from the parent. The sidebar showed only the parent session's own cost, and the history task block had no cost line at all.
Add Session.cost(sessionID) that BFS-walks descendants and sums assistant message cost across the subtree, exposed via a new GET /session/:id/cost route (Hono + HttpApi parity). The TUI sync caches the rollup and invalidates it on message.updated for any completed assistant message, so subagent completions propagate to ancestor sidebars without tracking parent_id chains client-side.
Sidebar now renders $X.XX ($Y.YY subagents) spent when subagents exist, and the completed Task tool footer in the message stream gains a · $X.XX suffix showing that subagent task's total spend (its own plus its own descendants).
Issue for this PR
Type of change
What does this PR do?
Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.
If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
I ran the prompt "I want to test subagent cost feature. use @explore to in parallel for @src/ and @specs/ and explain their contents to me"
Screenshots / recordings
Checklist
If you do not follow this template your PR will be automatically rejected.