[Conformance] Claude Code host: the shim stops waiting for the Guardian at 300 s, whatever timeout was negotiated
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 66/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- bun, typescript
Direzione di ricerca
Inizia nello shim di Claude Code, in refimpl/claude-code-read/hosts/claude-code/guardian-client.ts: il fetch alle righe 199-206 è limitato solo da AbortSignal.timeout(timeoutMs), quindi scatta prima il default di 5 minuti di inattività del socket di Bun, e il messaggio alla riga 218 riporta il timeout richiesto anziché il tempo trascorso. Leggi instrument §6.4 e hosts/claude-code/settings.json, poi riproduci con un Guardian stub che annuncia default_ms: 900000 e risponde a 360 s. Fatto significa che la decisione in ritardo ma dentro la finestra viene rispettata in entrambe le posture e che la voce di audit indica il tempo effettivamente atteso; vale la pena aggiungere un test unitario che non richieda un orologio da parete da 360 s.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 183
- Fork
- 56
- Merge medio
- 3g 1h
- PR unite (30g)
- 67
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GenAI-Security-Project/agent-control-standard
-
status:needs-triage type:bug workstream:refimpl
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
GenAI-Security-Project/agent-control-standard#764 ·
I maintainer di solito rispondono entro 1 giorno
-
status:needs-triage type:docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 96/100
GenAI-Security-Project/agent-control-standard#717 ·
I maintainer di solito rispondono entro 1 giorno
-
status:needs-triage type:docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
GenAI-Security-Project/agent-control-standard#650 ·
I maintainer di solito rispondono entro 1 giorno
-
[Conformance] Tool-call trace spans are dropped by a GenAI backend: no gen_ai.operation.name, span name is not execute_toolForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertastatus:needs-triage type:conformance
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
GenAI-Security-Project/agent-control-standard#520 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Docs] The A2A page says `must` for a wire deferred to v0.2Forse di nuovo libera @Lrd0036 l’ha presa 31 giorni fa e non c’è nessuna pull request aperta. Apertascope:in-focus status:accepted type:docs workstream:docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
GenAI-Security-Project/agent-control-standard#391 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di GenAI-Security-Project/agent-control-standard
Issue simili
-
Media browser returns "Not found" for repositories using the SHA-256 object formatForse già presa @adamchodera l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Follow-ups from #312Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
janhesters/remixcn#318 ·
I maintainer di solito rispondono entro 1 giorno
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
danielmiessler/LifeOS#3150 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Make the "%" unit spacing the same in the web and in A10Forse già presa @kragent66-glitch l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 commento ·