Skip to content

fix: record workflow tool parts in audit metadata - #1091

Merged
sidneyswift merged 1 commit into
mainfrom
codex/workflow-tool-count
Oct 21, 2026
Merged

sidneyswift merged 1 commit into
mainfrom
codex/workflow-tool-count

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow audit records currently report zero tool parts because the main workflow never supplies the count to the existing audit writer. Count top-level static/dynamic tool UI parts in the accumulated assistant message and forward that optional metadata through handleChatCredits.

This is a bounded successor to #649. The count includes pending/failed parts and preexisting parts in a resumed message; it is not successful executions, incremental resume work, or nested subagent usage. Credit calculations, amounts, account/model attribution, charge conditions and workflow boundaries remain unchanged. No migration or historical backfill.

Validation:

  • Six regression tests failed before wiring; 213 focused tests across 36 files now pass.
  • Full lint and diff checks pass.
  • Whole-project local typecheck retains the same 211 baseline diagnostics by path/code/message; one existing test diagnostic moved two lines.
  • Independent Spec and Standards review clear at 9364e765d5b38b51fed75dd2801c396cdccc5616 (tree 19add370db831f2cf80528180c73358cee21b7dc, base 5c0e585d0e12277abc57160129f35b02c9e7cacf).
  • Tests mock external workflow/credit/provider leaves. No live workflow, database write, credit deduction, customer job or credential inspection performed. CI and preview compilation tracked separately.

Summary by cubic

Fixes workflow audit records reporting zero tool calls because the main workflow never supplied the count to the existing audit writer. Counts tool UI parts in the accumulated assistant message and passes the optional count through handleChatCredits into audit metadata, without changing credit calculations, amounts, charge conditions, or workflow boundaries.

Tool call counting

  • Counts top-level static and dynamic tool UI parts, including pending and failed parts, and preexisting parts in resumed messages.
  • Excludes successful-execution counts, incremental resume work, and nested subagent output.
  • Omitted when the count is undefined, preserving the writer's existing zero default.

Written for commit 9364e76. Summary will update on new commits.

View guided diff Turn on auto-fix

@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Oct 21, 2026 9:10pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: recoupable/api/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc61c44f-614a-453e-87b6-c0da85e4f367
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch was successfully deployed

1 active deployment
Preview — 9364e765 Deployed Oct 21, 2026 by vercel[bot]
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