Skip to content

feat: persist structured subagent usage#138

Open
leset0ng wants to merge 1 commit into
tintinweb:masterfrom
leset0ng:feat/persist-structured-usage
Open

feat: persist structured subagent usage#138
leset0ng wants to merge 1 commit into
tintinweb:masterfrom
leset0ng:feat/persist-structured-usage

Conversation

@leset0ng

Copy link
Copy Markdown

Summary

  • capture each finalized assistant message as { timestamp, provider, model, usage }
  • expose usageRecords on subagents:completed and subagents:failed
  • persist the same records in the parent session's subagents:record entry
  • keep the existing billed-token/UI semantics unchanged (input + output + cacheWrite)
  • emit only newly generated records for resumed invocations to avoid duplicate analytics entries

This gives cross-session analytics extensions a durable source for subagent model attribution, cache usage, and itemized cost without reading temporary sidechain transcripts or duplicating message content.

Closes #137.

Validation

  • npm run lint
  • npm run typecheck
  • npm run test (677 passed, 4 live tests skipped)
  • npm run build
  • npm run test:e2e (37 passed, 4 live tests skipped)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist structured subagent usage for extension consumers

1 participant