[Conformance] Claude Code host: the shim stops waiting for the Guardian at 300 s, whatever timeout was negotiated
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bun, typescript
Research direction
Start in the Claude Code shim's refimpl/claude-code-read/hosts/claude-code/guardian-client.ts: the fetch at lines 199-206 is bounded only by AbortSignal.timeout(timeoutMs), so Bun's 5-minute socket idle default fires first, and the message at line 218 reports the requested timeout rather than elapsed time. Read instrument §6.4 and hosts/claude-code/settings.json, then reproduce with a stub Guardian that advertises default_ms: 900000 and answers at 360 s. Done means the late-but-in-window decision is honored under both postures and the audit entry states the time actually waited; a unit test that does not need a 360 s wall clock is worth adding.
Written by the indexing model from the issue text.
Description
What you ran
Claude Code 2.1.325 (claude-opus-5-5, -p, default permission mode) with the Claude Code shim from PR #597 (refimpl/claude-code-read at 201ddb3, on integration d3323ba), Bun 1.3.11 and the shipped hosts/claude-code/settings.json. In place of the reference Guardian I used a stub that answers handshake/hello with timeout_config.default_ms: 900000 and sends each decision 360 s after the request, well inside the negotiated window. The agent reads a file holding the AWS documentation example key. I ran 3 runs per case, with a fresh stub and session each time, and read what reached the model from the API requests that Claude Code records in the session transcript.
What you expected
Instrument §6.4 says the Observed Agent "MUST wait for the Guardian's decision, up to the negotiated timeout", and "When a decision does arrive within the timeout, the agent MUST honor it regardless of the posture." With 900 s negotiated, a decision at 360 s should be applied.
What happened
The shim stops waiting at 300 s and applies the failure posture.
Under deny, with a Guardian that would answer allow, PreToolUse returns a block at 300.05 s and the Read never runs (3/3). The Guardian would have allowed the call.
Under proceed, with a Guardian that would answer deny, PreToolUse returns at 300.05 s with no decision and the Read runs 60 s before the deny arrives (3/3). PostToolUse then gives up at 300.06 s as well and proceeds, so the key is in the next request to the model. The Guardian would have denied the call.
In both cases every audit entry records timeout with "guardianClient.post: no response within 900000ms". That is the negotiated value, not the 300 s the shim actually waited. The message comes from guardian-client.ts:218, which reports the timeout it was given rather than the time that passed.
The 300 s come from Bun's fetch, not from the shim's own timer:
guardian-client.ts:199-206bounds the call withAbortSignal.timeout(timeoutMs)and nothing else;- the Bun reference for
BunFetchRequestInit.timeoutsays it controls "the socket idle timeout for this request", with a default of 5 minutes, and "This is not a whole-request deadline; useAbortSignal.timeout(ms)for that"; - in a standalone Bun 1.3.11 test against a server that never answers,
AbortSignal.timeout(900000)alone fails withTimeoutErrorat 300.0 s, and addingtimeout: falselets the call run until a 420 s abort, at 420.0 s (4 runs, 3 of them as separate processes).
The 300 s also run from the handshake's request, not from the step's own start. When a handshake/hello is answered after 4.5 s and the next request on that connection gets no answer, that request fails 295.5 s after it starts, 300.0 s after the hello started (3 pairs, each with its own server, in one process). The Bun reference says the timer "is reset on every byte sent or received", but on 1.3.11 the hello's response and the next request did not reset it. Through the shim, a PostToolUse that has to renegotiate first (session store not writable) still ends at 300.05 s (3/3).
With the default 5000 ms the shim waits the negotiated time. In a replay against a stub that never answers, the hook ends at about 5.07 s and the audit says no response within 5000ms. The gap opens only when a Guardian negotiates more than 300 s. The reference Guardian does not, since it advertises a fixed DEFAULT_TIMEOUT_MS = 5000 (packages/guardian/src/handshake.ts:82) with no setting to change it. Another Guardian can, because handshake.json gives default_ms a minimum of 1 and no maximum.
Related: #434 lists "A timeout or a late response under Claude Code" among the scenarios no run has covered, and these runs cover the timeout half. #435 is about a decision that arrives after the negotiated timeout, while here it arrives inside it. #269 is about the Guardian's OPA deadline, which is a different timer.
Current Priority Scope
Feeds conformance evidence
- Dominant language
- TypeScript
- Stars
- 183
- Forks
- 56
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 67
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GenAI-Security-Project/agent-control-standard
-
status:needs-triage type:bug workstream:refimpl
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
GenAI-Security-Project/agent-control-standard#764 ·
Maintainers usually reply within 1 day
-
status:needs-triage type:docs
Difficulty 1/5 Under an hour Newbie friendliness 96/100
GenAI-Security-Project/agent-control-standard#717 ·
Maintainers usually reply within 1 day
-
status:needs-triage type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
GenAI-Security-Project/agent-control-standard#650 ·
Maintainers usually reply within 1 day
-
[Conformance] Tool-call trace spans are dropped by a GenAI backend: no gen_ai.operation.name, span name is not execute_toolMay be free again A pull request for this issue was closed without being merged. Openstatus:needs-triage type:conformance
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
GenAI-Security-Project/agent-control-standard#520 · 1 comment ·
Maintainers usually reply within 1 day
-
[Docs] The A2A page says `must` for a wire deferred to v0.2May be free again @Lrd0036 claimed this 30 days ago, and no pull request is open. Openscope:in-focus status:accepted type:docs workstream:docs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
GenAI-Security-Project/agent-control-standard#391 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in GenAI-Security-Project/agent-control-standard
Similar issues
-
[Bug]: A Markdown link with both a :line suffix and a #L fragment opens a path containing ":line"Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
TanbirRamim/vibereel#39 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 72/100
lingdojo/kana-dojo#34988 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
mastra-ai/mastra#32336 · 1 comment ·
Maintainers usually reply within 1 day