Aias00 opened a new issue, #4954:
URL: https://github.com/apache/rocketmq-dashboard/issues/4954

   ## Problem
   
   When an AI agent CLI run exceeds its provider timeout (or the waiting thread 
is interrupted), `ClaudeCodeAgentProvider` calls `Process.destroyForcibly()` 
only on the CLI process. The CLI can spawn `rmqctl` as an MCP stdio descendant, 
and the JDK does not propagate `destroyForcibly()` through the process tree. 
The descendant can therefore survive the failed run, retain resources, and 
continue work after RocketMQ Studio has already reported the run as timed out.
   
   The user-initiated Stop path already handles this correctly in 
`AgentRunHandle`: it snapshots descendants, terminates descendants before the 
root process, and bounds the final wait. The provider failure paths currently 
bypass those semantics.
   
   ## Proposed design
   
   1. Extract the descendant enumeration and force-termination behavior into a 
small shared process-tree helper.
   2. Use that helper from the provider timeout, I/O cleanup, and interruption 
paths so every provider-owned failure terminates descendants before the CLI 
root.
   3. Keep the existing graceful Stop behavior in `AgentRunHandle`; only its 
hard-kill phase should delegate to the shared primitive.
   4. Preserve the existing timeout/interruption status codes and interrupt 
flag behavior.
   
   ## Test plan
   
   - Add a provider timeout regression test with a fake CLI process and 
descendant handle; assert descendant termination occurs before root termination.
   - Extend the interruption regression to assert the descendant is also 
terminated while the interrupted flag remains set.
   - Run the focused provider and run-handle tests, followed by the server test 
suite and style checks.
   
   ## Acceptance criteria
   
   - No descendant process remains alive after an agent CLI timeout.
   - Interruption and provider cleanup paths use the same process-tree 
termination behavior.
   - User Stop retains its graceful-first behavior and descendant cleanup.
   - Existing error codes and response behavior do not change.
   


-- 
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