Skip to content

Answer only the approval the user heard, and only with all it runs - #7

Closed
ergoTech wants to merge 1 commit into
devXpro:mainfrom
ergoTech:fix/answer-approval-binding
Closed

ergoTech wants to merge 1 commit into
devXpro:mainfrom
ergoTech:fix/answer-approval-binding

Conversation

@ergoTech

@ergoTech ergoTech commented Dec 1, 2026

Copy link
Copy Markdown

answer_approval could allow a request the user never heard, and a long command was shortened in everything the assistant reads before it was allowed.

What changes

  • answer_approval takes the request's id (read_approval gives it) and answers only a request that still waits with that id. Without an id, or with a stale one, nothing is answered and the requests waiting now come back (needs_request, request_changed). It no longer picks the first request, a number in the list, or a match by words.
  • Allow takes a confirmation: an HMAC over the chat, the request's id and kind, the tool's name, title and description, its detail and input, and the button allow presses. Changed content, another request, another chat or an expired token allow nothing.
  • read_approval and needs_confirmation give each request whole, with its [request …] and [confirmation …]. Content over 6000 characters is allowed in Paseo (too_long); deny still works here.

Checks

  • npm run check: 408 tests green. The new tests fail on main.
  • Tried on a live Paseo with test chats: a missing, wrong, stale or forged id or token, and a token from another chat, allow nothing; allow with a valid token goes through.

Docs (docs/tools.md, docs/security.md) and the changelog are updated.

🤖 Generated with Claude Code

answer_approval answered the first waiting request, a number in the current list or a request matched by words, and a command longer than its line was shortened in every answer the assistant reads. The list changes while the user listens, so an "allow it" could reach a request nobody read out, and a long command could be allowed after only its start was heard.

- answer_approval takes the request's id and answers only a request that still waits with that id; without one, or with a stale one, nothing is answered and the requests waiting now come back (needs_request, request_changed).
- Allow takes a confirmation: an HMAC over the chat, the request's id and kind, the tool's name, title and description, its detail and input, and the button allow presses. Content that changed under the same id, another request and an expired confirmation allow nothing.
- read_approval and needs_confirmation give each request whole, with its [request] and [confirmation]. Content over 6000 characters is allowed in Paseo (too_long); deny still works here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@devXpro

devXpro commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Thanks, Egor, you found a real bug: a lone waiting request was allowed whatever it was, so one answered in Paseo and replaced while the user listened could be allowed unheard.

I fixed it in a smaller way on main (b00d434, with you as co-author) instead of rebasing this branch, which conflicted with 1.2.1 and 1.3.0:

  • Kept: answer_approval answers only the request named by its id; without an id or with a stale one nothing is answered (needs_request, request_changed) and what waits now comes back with its [request …]. Your id-binding tests are ported.
  • Left out: the HMAC confirmation, the JSON content readout and too_long. Paseo's request ids are unique per request, so the id already binds the content, and reading up to 6000 characters of JSON aloud (a diff, a long plan) hurts voice use; a plan over the limit could no longer be implemented by voice at all.
  • Added: a chat's state carries [request …] when its line is the whole request and the only one, so "allow it" after an overview stays one call.

Tested on a live Paseo: no id and a stale id allowed nothing; the right id implemented a plan.

@devXpro devXpro closed this Dec 2, 2026
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.

2 participants