Repository navigation
feat(gateway): an nl action's action_ok counts the calls its executor made for the fire - #496
Merged
Merged
Conversation
… made for the fire
`action_ok` for an nl action meant only that the executor's A2A task completed; whether the colleague posted, or
said nothing, took reading the env and a global changelog bracket that concurrent writes also move. Each fire in
flight now counts its executor's tool calls by tool, so the detail reads `calls: {"slack_send_message": 1}` for a
reply, `calls: {}` for a silence, and `failed_calls` for calls that came back as errors. Counts, not a list, so
the event's size is bounded by the env's tools, not by how many calls an executor makes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n_ok now carries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lls with An executor's calls carry only its role, so two fires it realizes at once both count every call made during either. `calls_shared_with` now names the overlapping triggers beside the counts, instead of leaving two identical tallies to read as twice the work. The in-flight record is built by `_in_flight_fire`, which the gateway tests that seed `_in_flight` use too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lap test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…or calls Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
@greptileai review |
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.
Summary
For an
nlaction,action_okmeant only that the executor's A2A task completed. It said nothing about whether the colleague did anything. "Replied" and "decided to stay quiet" looked the same, so telling them apart meant reading the env, or thechangelog_id_before/afterbracket, which concurrent writes from the agent and other triggers also move.Each fire in flight now counts the tool calls its executor makes for it, by tool, and the nl
action_okdetail carries the counts:{"nl": "reply to the agent in the DM...", "executor": "brooke", "calls": {"slack_conversations_history": 2, "slack_send_message": 1}} {"nl": "reply to the agent in the DM...", "executor": "brooke", "calls": {}} {"nl": "...", "executor": "brooke", "calls": {"slack_conversations_history": 1}, "failed_calls": {"slack_send_message": 1}} {"nl": "...", "executor": "tony", "calls": {"slack_send_message": 2}, "calls_shared_with": ["t-dm"]}callscounts the executor's calls that succeeded.failed_callsappears only when some calls came backisError.calls_shared_withappears only when another fire of the same executor was in flight at the same time; it names those triggers (see below).How
on_tool_callalready runs for every external call, executors' included. At its top, a call by a role that has fires in flight adds one to each of those fires' counts._in_flight[role]now holds a small record per fire, built by_in_flight_fire: its cause, the two counts, and the triggers it overlapped.caused_bystill returns just the causes, so trajectory attribution is unchanged._run_nlreturns the fire record, orNonewhen the action failed.Semantics worth knowing:
caused_byalready applies, since an executor's calls carry only its role. Both fires name each other incalls_shared_with, so the two identical tallies don't read as twice the work.Compatibility
The detail is additive. The explorer and the verifiers'
run_contextreadexecutor/nlor passdetailthrough. Three gateway tests that seed_in_flightby hand now build the record with_in_flight_fire.Testing
tst/unit/env/gatewayplustst/unit/task_step, 3013 passed. The new test covers:{};caused_byemptying afterwards;calls_shared_with.test_each_nl_action_reaches_the_executor_it_namesnow asserts each executor's counts,{"items_whoami": 1, "items_add_item": 1}. On a Linux VM, the local trigger suite plusgateway_test.py's trigger, change-attribution, barrier and mirror tests gave 15/15.{"items_whoami": 1, "items_add_item": 1}.{}.calls: {"items_whoami": 1}, failed_calls: {"items_add_item": 1}.{"items_whoami": 1000}in a 251-byteaction_ok, with the gateway answering in about 7 ms afterwards.{"items_whoami": 2, "items_add_item": 2}, which is the overlap rule above, and name each other (twice-1readscalls_shared_with: ["twice-2"], and the reverse). Fires that didn't overlap carry nocalls_shared_with.action_failed. A call it makes after the fire timed out carries nocaused_by, so the fire left nothing behind in_in_flight.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Adds per-tool call counts to an
nlaction’saction_okdetail.nlactions now show what their executors did.No actionable issues were found in the changes since the previous review or the full-PR rules check.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[NL action starts] --> B[Register fire under executor role] B --> C[Record overlapping trigger IDs] C --> D[Executor makes tool calls] D --> E[Count each result for active fires] E --> F[Executor finishes] F --> G[Remove fire from active list] G --> H[Emit action_ok with counts and overlap IDs]Reviews (2) · Last reviewed commit: "test(gateway): the overlap test opens bo..." · Reviewed by Greptile