Repository navigation
Conversation
This was referenced Nov 19, 2026
xeophon
marked this pull request as ready for review
November 19, 2026 01:13
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Tool receipts are matched against both the harness-replayed prompt and the model-facing transcript, preserving policy-substituted results across replays. The change remains session-local and retains existing tool-gating and ambiguity safeguards. You can add or adjust custom eligibility rules. Learn more. |
xeophon
force-pushed
the
codex/3205-mediated-replay
branch
from
November 19, 2026 01:30
97a1b67 to
cc9d178
Compare
xeophon
force-pushed
the
codex/3205-tool-issuers
branch
from
November 19, 2026 01:30
cdf4ed1 to
23e57cb
Compare
This branch has not been deployed
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.
Removing a provider tool under a restricted network policy also inserts a notice into the model’s prompt. The harness replays its original prompt. Register each sampled call against that history and carry forward the tool results the interceptor already substituted. A loopback HTTP reproduction with two successive tool calls verified that replaying the older branch delivers both of its original substitutions.
Local unit suite on this commit reported 299 passed, 19 skipped. Full-stack CI
Layer 3 of 13. Builds on #3209. Stack index
Note
Match tool receipts against the prompt the harness replays
InterceptionServernow captures the incoming request messages as harness history and passes them togate_tool_callsafter the response commits. When request rewriting changes the request, rewrittenToolMessageentries are substituted into that history so gating sees the prompt actually replayed.RolloutSession.gate_tool_callsaccepts an optionalharness_historyargument and registers the current node as issuer for each call under both the trace-branch history and, when distinct, the supplied harness history. This makes issuer keys match either transcript.tool_issuerswhile deriving a call's key.AnthropicDialectandNetworkPolicyConfig, and to cover repeated call IDs, changed tool catalogs, and ambiguous issuing turns.Macroscope summarized cc9d178.
Note
Medium Risk
Changes core tool-call gating and pinned-result matching on the model interception path; incorrect prefix hashing could mis-attribute issuers or lose rewritten tool results.
Overview
Tool-call issuer tracking now keys off the conversation the harness will replay, not only the trace branch. The interception server keeps harness history after
rewrite_request—original messages with pinnedToolMessagesubstitutions merged in—and passes that transcript intogate_tool_calls.RolloutSession.gate_tool_callstakes an optionalharness_historyand registers sampled calls under prefix hashes for both the graph branch and the harness history when they differ (e.g. network policy notices or filtered Anthropic prompts). Issuer registration duringtool_result_keyspath scanning was removed so mapping happens at gate time instead.Unit coverage in
test_agent.pyexercises provider-tool filtering, gating with native vs model-facing messages,pin_tool_resultson model receipts, and follow-up tool calls across replays.Reviewed by Cursor Bugbot for commit cc9d178. Bugbot is set up for automated code reviews on this repo. Configure here.