Closed bug report

shell_execute approval expires at 60 s and reports the expiry as 'Command denied by user' (from kicad-bridge#108)

John Lauer · 1mo ago ·closed by John Lauer

From adom/kicad-bridge#108 (Kyle Bergstedt, macOS, adom-bridge-macos 1.9.209, adom-bridge 2.1.129), an observation on shell_execute that reads as ab's approval flow rather than any bridge:

Three attempts returned stderr: "Command denied by user" at durationMs 60016, 60025 and 60029, each within 13 ms of exactly 60 s, which is not a human clicking. Passing timeoutSeconds: 1800 does not extend it, since that governs command runtime rather than the approval wait.

If the approval dialog expires at 60 s and the expiry is reported as an explicit deny, both sides are misled: the agent concludes the user refused, the user believes they granted permission. Ask: a distinct errorCode such as approval_timeout (and a reply that says the dialog expired) so the caller can re-request instead of backing off, plus a way to lengthen the approval wait for long-running installs.

Filed by the KiCad Bridge owner on Kyle's behalf; the original report has the full context.

2 Replies

John Lauer · 1mo ago

Ack, real: handle_shell_command holds the request for a fixed 60 s and a lapse is reported with the same 'Command denied by user' text as a click on Deny. Fix planned for the next insiders build: errorCode approval_timeout with a message that says the dialog expired (the human did not answer), and an approvalWaitSec arg (capped) for long installs; the 60 s stays the default so an unattended call still fails fast. Will note here when it ships.

John Lauer · 1mo ago

Fixed in insiders 2.1.132 (published: release row + insiders manifest + pkg adom/[email protected] with the Linux CLI).

What changed

  • A per-command approval nobody answers now returns errorCode: "approval_timeout", stderr Approval dialog expired after Ns: nobody answered (this is NOT a deny), plus approvalWaitSec, approvalWaitMaxSec and a _hint telling the agent to re-request (a longer wait, or request_shell_approval {wait:true,timeoutSec} then retry). An explicit Deny click is errorCode: "approval_denied" with the old stderr text. The mirrored card (Hydrogen, other boxes) is dismissed with decision expired, not denied.
  • New arg approvalWaitSec (aliases approval_wait_secs, approvalWaitSeconds): how long ab holds the prompt. Default stays 60 s so an unattended call still fails fast; max 600 s for a long install. timeoutSeconds bounds the run only, as before.
  • The pending reply carries holdSec (wait + run budget + 30 s); the relay keeps its deferred slot for that long instead of a fixed 5 min, and the CLI polls for at least that long, so a long wait or a long run cannot be cut off in the middle by the plumbing.

Proof (arav-rog on 2.1.132, standing grant dropped, prompts deliberately left unanswered, called from a container over the relay):

approvalWaitSec reply wall
20 approval_timeout, "expired after 20s ... NOT a deny" 20.1 s
90 approval_timeout, "expired after 90s" 90.1 s (past the old 60 s cap)
(omitted) approval_timeout, "expired after 60s" 60.0 s

ab's own log on the box records Shell command approval expired after 20s/60s/90s (no answer) for each, distinct from the denied by user line a Deny writes.

For Kyle's case: pass approvalWaitSec: 600 on the install command (or call request_shell_approval {wait:true,timeoutSec:600} first, then retry once it answers granted), and treat approval_timeout as "ask again", never as a refusal. Skills updated (adom-bridge-permissions quick reference, shell_execute help text).

John Lauer closed this · 1mo ago

Log in to reply.