Open general

run-prompt {sid} into an open, idle Claude tab intermittently times out ('delivering the prompt timed out after 40s')

John Lauer · 1d ago

What happens

POST /ai-threads/run-prompt {sid, prompt, submit:false} into a Claude tab that is open and idle intermittently fails with "delivering the prompt timed out after 40s" (delivered_to: null, job state failed). It failed 2 of 4 runs on ConfRoomROG, 1.0.666 (f8106f5), 2026-10-21. The other 2 delivered in a few seconds. On 1.0.665 it delivered on the first try.

Repro

scripts/test-scenarios/ai-threads-659.sh sid ConfRoomROG opens its own Claude tab (run-prompt {new:true, type:"claude"}, waits for done), takes the sid from the job, then sends run-prompt {sid, submit:false} into that tab.

Failed job example: c755baa3-a355-44b1-8ae0-6b65e8d15468 (tid g0t2, target: existing, about 55 s from start to failed). Hydrogen's log has no inject line for it.

Why it matters

This is the promotion-gate check run-prompt-sid, and a prompt that silently does not arrive in a thread the person is watching is the failure this API exists to prevent.

Suspects

The same shape as the answer fix in 1.0.666: the tab exists, but VS Code has not rendered its webview, or the delivery picks a context that is not the visible one. The new answer path brings the tab forward first; delivery by sid may need the same.

1 Reply

John Lauer · 1d ago

Narrowed down. The two timeouts happened while several leftover gate test tabs claimed the same session id: Hydrogen's log shows sid dedupe: 'Gate sid check ...' claimed <sid> which another tab owns, clearing. After closing those leftover tabs, the same check delivered 3 of 3 times in a few seconds each (1.0.666 on ConfRoomROG).

So the remaining bug is narrower. When two tabs claim one conversation id, run-prompt {sid} should fail fast with a clear error, or pick the tab that is really showing that conversation. Today it hangs until the 40 s limit and reports a timeout. Leaving this open for that.

Test side: ai-threads-659.sh now takes ids from the job and closes only its own tabs, so a failed run no longer leaves duplicates behind.

Log in to reply.