Skip to content

Deny a held call before the host's hook timeout - #173

Open
cachafla wants to merge 1 commit into
mainfrom
hook-hold-wait
Open

cachafla wants to merge 1 commit into
mainfrom
hook-hold-wait

Conversation

@cachafla

Copy link
Copy Markdown
Collaborator

What

The shared agent hook (examples/shared-agent-hook/atryum-hook.mjs, installed by atryum setup claude and atryum hooks install claude-code|codex|cursor) polled a pending invocation with no limit. Claude Code and Codex kill a command hook after 600 seconds by default, and then let the tool call continue through their own permission flow (Claude Code hooks reference: "A timed-out command … hook doesn't block the tool call"). A call held for a reviewer longer than ten minutes therefore ran without approval.

The hook now denies the call once ATRYUM_HOLD_WAIT_MS (default 540000, nine minutes, counted from the hook's start) has passed while the invocation is still pending. The denial goes through the hook's existing error path (atryum: failed to gate tool call: still pending approval after 540s, so it was not run (invocation …)).

Why now

Agent Authority (validmind/agent-authority) now serves the endpoints Atryum's CLI and hooks use, so a team that piloted Atryum can point atryum setup claude --url at AA. AA's reviews wait up to 60 minutes, and its own hook already blocks at nine minutes. This is the one gap AA can't close on its side.

Scope

  • 10 lines in the hook, an env var row in the Claude Code and Cursor READMEs, a CHANGELOG entry.
  • TestHookDeniesAfterHoldWait runs the hook with node against a server that never decides (skipped without node). It fails without the change.
  • The Amp and Pi plugins run in-process, with their own host timeouts; unchanged.

Not to be merged without review. #170 and #171 are untouched.

🤖 Generated with Claude Code

Claude Code and Codex kill a command hook after 600 s by default and then
let the tool call run. The shared hook polled a pending invocation without
limit, so a call held longer than that ran unapproved. It now denies the
call after ATRYUM_HOLD_WAIT_MS (default 540000), counted from its start.

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

This branch has not been deployed

No deployments
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