Repository navigation
Conversation
There was a problem hiding this comment.
The change looks good. I ran the new wire test on the base branch: it reports 1.5 there and 3.75 with this change. All ACP tests and the cli tsc -b pass. The total adds up the session and all its descendants, the same way the TUI does for a root session, and it runs once per turn at settle, so the extra session.list calls are cheap.
Public API: unchanged. Only the value of the cost field in ACP usage_update changes.
One small concern is inline: if listing the subagent sessions fails, the whole usage update is now dropped.
There was a problem hiding this comment.
The fix for my earlier point works: when the subagent lookup fails, the usage update is still sent with the session's own cost, interruptions still pass through, and the new 500 test covers it. I also ran the #65616 reproduction from source with a mock provider. A subagent spent $100, and usage_update reported $3 on base and $103 with this PR. test/acp/prompt.test.ts and the cli tsc -b pass.
Public API: unchanged. Only the value of the cost field in ACP usage_update changes.
No further concerns.
Core stores each subagent's spend on its own session, so the ACP usage_update cost now sums the session and all its descendants, the same way the TUI computes a session family's cost. Closes anomalyco#65616
364efba to
df5c343
Compare
There was a problem hiding this comment.
The code is unchanged since my last review: the new commits have the same tree as 364efba and differ only in their messages. The earlier results still hold (#65616 reproduction: $3 on base, $103 with this PR; the prompt tests and the cli tsc -b pass).
Public API: unchanged. Only the value of the cost field in ACP usage_update changes.
No further concerns.
Issue for this PR
Closes #65616
Type of change
What does this PR do?
usage_updatereported only the root session's cost. Core stores each subagent's spend on its own session, soACP now adds up the session and all its descendants by paging
session.list({ parentID }), the same way theTUI computes a session family's cost. No core or protocol changes. Earlier attempts (#43645, #50737) added
the subagent costs inside core; this keeps the fix inside ACP.
The test fixture's fake
session.listnow filters byparentIDlike the real server does.How did you verify your code works?
New test in
test/acp/prompt.test.ts: root $1.50 + subagent $2 + its subagent $0.25, plus an unrelated $10session, reports 3.75. Without the fix it reports 1.5. All ACP tests and the cli typecheck pass.
Screenshots / recordings
N/A
Checklist