youngkermit8-coder opened a new issue, #1517:
URL: https://github.com/apache/rocketmq-dashboard/issues/1517

   ## Problem
   
   `ClaudeCodeAgentProvider.stream()` reads the child process stdout 
synchronously to EOF before it calls `process.waitFor(STREAM_TIMEOUT_SECONDS, 
...)`. A silent or long-running Claude CLI therefore blocks in `readLine()` and 
never reaches the configured timeout. The method also leaves stderr undrained 
while the process runs, so a child that fills the stderr pipe can deadlock even 
if stdout would otherwise complete.
   
   The non-streaming `CliAgentProvider.complete()` path was hardened in #1056, 
but the Claude streaming path still has the original ordering. This is the 
remaining streaming portion of the broader problem previously described in 
closed Issue #959; the earlier PRs were not merged in this form.
   
   ## Impact
   
   - A hung Claude CLI can retain an AI gateway worker indefinitely despite the 
advertised 300-second timeout.
   - Large diagnostics on stderr can fill the OS pipe buffer and deadlock the 
child and caller.
   - Repeated stuck streams can exhaust server-side chat capacity.
   
   ## Reproduction
   
   1. Substitute a controllable CLI command that sleeps without closing stdout.
   2. Override the stream timeout to one second for a test.
   3. Call `stream()`.
   4. Current behavior blocks while reading stdout and does not produce the 
expected 504 timeout.
   
   A second deterministic reproduction writes more than 64 KiB to stderr before 
emitting a valid stream-json result; the current method blocks because stderr 
is not drained concurrently.
   
   ## Scope
   
   - Drain stdout and stderr concurrently while the child is running.
   - Start the process timeout immediately after launch.
   - Destroy a timed-out child and preserve the existing structured 504 error.
   - Add focused regression tests for timeout enforcement and large stderr 
output.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to