[Bug] v0.8.0: multi-hour silent blocking inside a single anthropic-messages call; concurrent processes resume within the same second #2093
Replies: 1 comment
|
Investigated this report and produced a candidate fix, validated on a fork of this repository. Root cause, fix and validation from the working notes:
Diff: awhite0030/prime-agent@main...jules-5005970707589739706-fe90f932 The change passes |
Uh oh!
There was an error while loading. Please reload this page.
Affected area
AI providers and models
Coding agent and CLI
What happened?
prime-agent CLI v0.8.0 can block silently for multiple hours inside a single
anthropic-messagesprovider call. On one Linux host we observed several concurrent CLI processes stall at the same time: each emitted itsturn_startevent and then produced no further output — nomessage_end, no progress event, no error — for 3–5 hours. All of the stalled processes resumed within the same second, which points to blocking on a shared usage-window / rate-limit gate rather than per-request retries. In one case a token 401 error surfaced only at the tail, after the long wait had already ended.Practical impact: while blocked, the CLI gives the caller no signal at all. There is no way to distinguish a wedged process from a legitimate provider wait, no hook to apply our own timeout policy, and hours of wall-clock time are lost silently.
Steps to reproduce
We do not have a minimal deterministic reproducer — the trigger appears to be provider-side usage-window exhaustion — but the observed sequence is:
turn_startis emitted, then output stops.message_end, no error, no progress event) for 3–5 hours across all processes.Expected behavior
Actual behavior
Between
turn_startand the eventual resume there is complete silence for 3–5 hours: no progress event, no diagnostic, no timeout. All concurrently blocked processes resume within the same second. The 401 appears only after the wait completes.Prime Agent version
0.8.0
Installation method
npm package
Operating system
Linux
Operating system version
Ubuntu 24.04.4 LTS (kernel 6.8.0-138-generic)
CPU architecture
x86_64 / amd64
Shell and terminal
bash 5.2.21, non-interactive headless environment (CLI driven by automation, no terminal emulator)
Additional context
The synchronized resume is the strongest signal we have: independent processes with per-request exponential backoff would drift apart, but all processes here resumed within the same second, which means they were parked on the same shared wait — consistent with a shared usage-window gate.
The three requests above are about observability and boundedness, not about changing rate-limit behavior. Even a correct, vendor-intended gate wait should be visible and bounded to the caller: emit a diagnostic when entering the wait, emit periodic progress, and enforce a bounded maximum so the caller can retry or fail cleanly.
All reactions