Skip to content

[BUG]: Avoid flattening multiple model metering events into one - #7529

Open
tanujnay112 wants to merge 5 commits into
mainfrom
codex/subagent-usage-per-model
Open

[BUG]: Avoid flattening multiple model metering events into one#7529
tanujnay112 wants to merge 5 commits into
mainfrom
codex/subagent-usage-per-model

Conversation

@tanujnay112

@tanujnay112 tanujnay112 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stream the existing merged per-model usage totals from /api/agent immediately before the terminal done event
  • include input, output, cache-read, and cache-write token counts in each usage event
  • exercise aggregation of repeated same-model records while keeping models separate

Context

Testing

  • cargo test -p foundation-api agent::tests --tests
  • cargo test -p foundation-api subagent_search --tests

@github-actions

Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@tanujnay112 tanujnay112 changed the title Preserve search-agent subagent usage by model [BUG]: Avoid flattening multiple model metering events into one orb entry Jul 29, 2026
@tanujnay112 tanujnay112 changed the title [BUG]: Avoid flattening multiple model metering events into one orb entry [BUG]: Avoid flattening multiple model metering events into one Jul 29, 2026
@tanujnay112
tanujnay112 marked this pull request as ready for review July 29, 2026 21:59

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

…per-model

# Conflicts:
#	rust/agent/src/lib.rs
#	rust/agent/src/tool.rs
#	rust/foundation-api/src/agent_tools/subagent_search_tool.rs
#	rust/foundation-api/src/routes/agent/mod.rs
#	rust/foundation-api/src/routes/subagent_search/events.rs
#	rust/foundation-api/src/routes/subagent_search/mod.rs
#	rust/foundation-api/src/routes/subagent_search/tests/00_unit.rs
#	rust/foundation-api/src/routes/subagent_search/tests/01_integration.rs
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.

1 participant