Skip to content

Fix stack 07: tool-audit and tool-event parity#31

Merged
ebarti merged 3 commits into
review-fixes/06-usage-sessionfrom
review-fixes/07-tool-event-parity
Jul 2, 2026
Merged

Fix stack 07: tool-audit and tool-event parity#31
ebarti merged 3 commits into
review-fixes/06-usage-sessionfrom
review-fixes/07-tool-event-parity

Conversation

@ebarti

@ebarti ebarti commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Stacked review-fix PR 7/N (base: review-fixes/06-usage-session).

Tool audit/event parity across the three adapters (REVIEW.md §4):

  • Codex emitted no tool events despite populating result.tool_calls (and the matrix advertising tool-audit events). It now emits agent.tool.requested/agent.tool.completed parsed from the TurnResult, so a sink sees the same activity as the streaming adapters.
  • Claude result audits had empty result_preview even though its streamed tool_completed events carried it. The stream now records previews per tool_use_id and propagates them into result.tool_calls.
  • Antigravity counted a tool call only on ToolResult, dropping requested-but-unfinished calls. It now records on ToolCall and fills on ToolResult — one entry per invocation, matching Claude/Codex.

Tests for each. Full suite 168 passed / 12 skipped; ruff + mypy strict clean.

Note: the availability() credential-semantics asymmetry (§4) reflects real vendor auth-model differences (Claude/Codex support provider-owned local login; Antigravity needs explicit creds) and is addressed as documentation in the docs PR rather than by forcing false negatives.


Re-review amendment. Corrected the tool-preview comment: the sanitized tool_completed events expose only result_preview_length; the result audit is what carries the capped raw preview.

Also (second round): the Antigravity result merge previously replaced the pending audit wholesale, so a ToolResult chunk without args degraded arguments to {} — it now keeps the request-time arguments as fallback. The one-entry-per-invocation merge is finally pinned by tests (len == 1, status == "ok"), which no test previously verified.

@ebarti ebarti force-pushed the review-fixes/07-tool-event-parity branch from 477230f to e7de3ea Compare July 2, 2026 10:00
@ebarti ebarti force-pushed the review-fixes/06-usage-session branch from 23347cc to 2715737 Compare July 2, 2026 10:00
@ebarti ebarti force-pushed the review-fixes/07-tool-event-parity branch from e7de3ea to 81f913c Compare July 2, 2026 10:26
@ebarti ebarti force-pushed the review-fixes/06-usage-session branch from 2715737 to 22d6a8b Compare July 2, 2026 10:26
@ebarti ebarti force-pushed the review-fixes/07-tool-event-parity branch from 81f913c to ecf0954 Compare July 2, 2026 10:41
ebarti added 3 commits July 2, 2026 16:54
- Codex emitted no tool events despite populating result.tool_calls and the
  capability matrix advertising tool audit events. It now emits
  agent.tool.requested/agent.tool.completed (parsed from the TurnResult) so an
  observability sink sees the same tool activity as the streaming adapters.
- Claude's result.tool_calls carried empty result_preview even though its
  streamed tool_completed events had it. The stream now records previews per
  tool_use_id and _apply_tool_results carries them into the result audits.
- Antigravity counted a tool call only when a ToolResult chunk arrived, so a
  requested-but-unfinished call was missing from result.tool_calls. It now
  records the call on ToolCall and fills it on ToolResult, giving one entry per
  invocation (matching Claude/Codex cardinality).

Refs REVIEW.md §4.
…inality

The result merge replaced the pending entry wholesale, so a ToolResult
chunk without args degraded the audit's arguments to {}. Keep the
requested arguments as fallback, pin the one-entry-per-invocation merge
(len==1, status ok) that no test previously verified, and document the
no-correlation-id best-effort matching.
@ebarti ebarti force-pushed the review-fixes/06-usage-session branch from 1a81ea9 to 9d1b3ca Compare July 2, 2026 15:13
@ebarti ebarti force-pushed the review-fixes/07-tool-event-parity branch from ecf0954 to 121cbee Compare July 2, 2026 15:13
@ebarti ebarti merged commit 121cbee into review-fixes/06-usage-session Jul 2, 2026
8 of 16 checks passed
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