Repository navigation
Declared tools a client answers: hold, then park, with gates - #248
Conversation
A tool declared with `answered_by: TAG` takes no fixed result. A call that
fits its parameters waits for the answer of whichever client serves that
tag. The client finds it by following the bot (`tool_started` carries
`answered_by` and `expires_ms`) or with `tool_calls {tag}`, and answers with
`tool_result {output | error{code,detail}}`. The turn holds live for up to
250 ms, then parks like `wait` and survives restart. A call nobody answers by
`expire_ms` (default 60 s) ends as a typed `tool_unserved` result, and the
turn goes on.
Gates may now name declared tools, so a client's tool can need approval
before it is asked. Protocol 20, schema 55 (`answers` table).
The approval_overhead bench gains declared, answered and answered_parked
arms. Measurements are in DAEMON_MEASUREMENTS.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe46346eb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…r gate, gate what configure declares, refuse late answers Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGErsjQZRay4MEvYNpr
# Conflicts: # docs/RUST_PROTOTYPE.md # src/tools.rs # tests/store_contract.rs
|
@codex review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
This is step 2 of the tool-or-command rule (design page; George picked "Hold, then park"). Today a declared tool only records a fixed result. This change lets a client answer the call itself, so the next PR can turn Sonny's agent-only commands into tools: task start and rm, show, run, the lookout subscriptions, and project add.
What changes
answered_by: TAGon a declared tool (withexpire_ms, 1 ms to 1 h, default 60 s) takes the place ofresult. A call that fits the tool's parameters starts and then waits. Itstool_startednamesanswered_byandexpires_ms.tool_result {bot, turn, call_id, output | error{code,detail}}answers a call.call_already_answered,no_pending_call(the call ended or ran out of time),stale_turn,invalid_tool_resultandtool_output_limit.outputanddetailare each capped at 64 KiB and redacted the same way command output is.tool_calls {tag, after?, limit?}lists the calls still waiting, oldest first and paged. A client that starts late or restarts uses it to catch up.min(approval_hold_ms, 250 ms).waitdoes:turn_waiting {call_id, answer, deadline_ms}, also shown in the view aswaiting_on.expires_msends with{"error":"tool_unserved"}and the turn goes on. If a later call's gate lapses first, the wait ends the same way and the turn ends as a turn waiting on a verdict does.set_gateandconfigure. Onconfigure, the gate is checked against the declarations sent in the same request. A gate's tool limit is now the registered tools plusMAX_DECLARED.inherit: false(Sonny: group the lead's tasks by state in /status, and let the lead resolve them #244) works with answered tools unchanged.answerstable, no data to move).Where this differs from the design page
serve_toolslease and notool_requestedpush. A client follows*or callstool_calls, so nothing that isn't durable can be lost. A tag is the client's to serve.expired: trueflag ontool_completed. The expiry is the typedtool_unservedoutput.Measurements
Main is
cf8cf65. Full tables are indocs/DAEMON_MEASUREMENTS.md, under "Answered declared tools". All figures are per turn.An answer within the hold adds no fsync. The 32-bot completion burst and the 32-bot echo lifecycle are within noise of main.
Tests
tests/test_answered.py(9 tests):configuredeclaring and gating at oncecargo test --workspace --no-fail-fastpasses except two SandFS tests insonny/tests/task.rs, which also fail on main in this container withoutfusermount3. CI installsfusermount3. The full runtime suite passed before the merge with main.No visible change, so no screenshots.
🤖 Generated with Claude Code