Fix stack 07: tool-audit and tool-event parity#31
Merged
ebarti merged 3 commits intoJul 2, 2026
Conversation
477230f to
e7de3ea
Compare
23347cc to
2715737
Compare
e7de3ea to
81f913c
Compare
2715737 to
22d6a8b
Compare
81f913c to
ecf0954
Compare
- 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.
…he preview length
…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.
1a81ea9 to
9d1b3ca
Compare
ecf0954 to
121cbee
Compare
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.
Stacked review-fix PR 7/N (base:
review-fixes/06-usage-session).Tool audit/event parity across the three adapters (REVIEW.md §4):
result.tool_calls(and the matrix advertising tool-audit events). It now emitsagent.tool.requested/agent.tool.completedparsed from theTurnResult, so a sink sees the same activity as the streaming adapters.result_previeweven though its streamedtool_completedevents carried it. The stream now records previews pertool_use_idand propagates them intoresult.tool_calls.ToolResult, dropping requested-but-unfinished calls. It now records onToolCalland fills onToolResult— 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_completedevents expose onlyresult_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
argumentsto{}— 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.