feat: token report covers workflow subagents and adds a per-agent wall-clock table - #421
Merged
Merged
Conversation
…the token report Red first: fixtures for a synthetic workflow session and failing tests for perAgent, the By agent table and the unread-path line (issue #416). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lock table Workflow subagent transcripts under subagents/workflows/<run>/ were never read, so a workflow's whole cost was missing from the report. They now count under a workflow:<name> role. A new By agent table shows calls, tool uses and wall-clock per agent, from measured task-notification durations where they exist and from marked transcript spans otherwise. Paths that were found but not read are named in Limitations. Bumps the plugin to 2.8.0. Closes #416 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
Author
Tester report, fix round 1/3 (batch #417)VERDICT: FAIL
Lead note: the dispatch wording in the untested-claims line was the lead's error (a sum of parallel spans, where the sub-plan meant their union). Not a finding against the PR. |
4 tasks
An unreadable transcript is now named by its directory and a count, and any agent-<id> in an unread entry is redacted, since the report is posted to public issues. A newline in a workflow label no longer splits its table row. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
Author
Tester report, re-test after tester fix round 1/3 (batch #417)VERDICT: PASS |
4 of 19 tasks
Owner
Author
Reviewer report (batch #417)VERDICT: APPROVE
|
sv-tmueller
marked this pull request as ready for review
October 1, 2026 08:40
This was referenced Oct 1, 2026
sv-tmueller
added a commit
that referenced
this pull request
Oct 1, 2026
PR #421 merged first with 2.8.0, so this branch's 2.7.1 bump no longer moves the version forward. Resolve to the next patch level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Closes #416
Part of batch #417. Follows the architect's sub-plan on #416.
What changes
token-report.mjsreads workflow subagent transcripts undersubagents/workflows/<runId>/. They count under the roleworkflow:<workflowName>(the Workflow launch's name, elseworkflow:<runId>), in the by-role and by-model tables. Model comes from each call, never from the sidecar alias.perAgent()and a## By agenttable: Start (UTC), Role (with the agent() label for workflow agents), Model, Calls, Tool uses, Output (est.), Wall-clock, Source. No agent hex ids appear in the output.duration_msfrom task notifications when it has at least one and all are positive (copies in the three notification carriers are merged, tool-result text is never read). Otherwise it uses the sum of per-run transcript spans, marked(est.); a coordinator line starts a new run, so a resumed seat does not count the idle gap. Workflow subagents use their span (est.). The lead uses its first-to-last span in the window (est., includes idle time). No positive value givesn/a.subagents/that were found but could not be read (unknown directories, readdir or readFile errors) are named in Limitations and left out of every total.render()prints the new table and lines only when there is something to show, solead-dedupe.snapshot.mdis unchanged. Neither SKILL.md needed an edit.plugin.json2.7.0 to 2.8.0. Other batch PRs also bump it; that conflict is for merge time.Verification
npm testexits 0 (415 tests). Fixtures are synthetic only (fixtures/token-report/cli-config/projects/test-project/workflow-session*). Tests were written first and failed on the missingperAgentexport before the implementation.tm-review-changesrun: 1workflow:tm-review-changesrole row, 8 workflow agent rows, 16 agent rows in total, nothing found-but-unread, no agent hex in the output. Nothing from the real transcripts is in the repo.No new dependencies.
🤖 Generated with Claude Code