fix: use kiro-cli-chat directly to prevent orphan child processes#129
Open
vokako wants to merge 1 commit intoopenclaw:mainfrom
Open
fix: use kiro-cli-chat directly to prevent orphan child processes#129vokako wants to merge 1 commit intoopenclaw:mainfrom
vokako wants to merge 1 commit intoopenclaw:mainfrom
Conversation
9ea1acc to
2316e1a
Compare
kiro-cli is a wrapper that forks kiro-cli-chat as the actual ACP server process. When acpx sends SIGTERM to kiro-cli on session close, only the wrapper is killed while kiro-cli-chat continues running as an orphan process. These orphaned processes accumulate over time and cause port/resource conflicts that result in ACP_TURN_FAILED errors on subsequent messages in persistent sessions. Fix: point the built-in kiro agent directly at kiro-cli-chat acp, bypassing the wrapper entirely. This ensures clean process lifecycle without needing process group kill logic. Related: openclaw#42 (proposed process group cleanup approach — this commit provides a simpler fix by avoiding the wrapper altogether)
2316e1a to
f7bd853
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
kiro-cliis a wrapper that forkskiro-cli-chatas the actual ACP server process. When acpx sends SIGTERM tokiro-clion session close, only the wrapper is killed — the child processkiro-cli-chatcontinues running as an orphan.These orphaned processes accumulate over time and cause resource conflicts, resulting in
ACP_TURN_FAILEDerrors (exit code 1) on subsequent messages in persistent sessions. The first message in a session works fine, but follow-up messages fail because the stalekiro-cli-chatprocess is still holding resources.Fix
Point the built-in kiro agent directly at
kiro-cli-chat acp, bypassing the wrapper entirely. This ensures clean process lifecycle management without needing process group kill logic.One-line change in
src/agent-registry.ts:Related
detached:true+process.kill(-pgid)). This PR provides a simpler alternative by avoiding the wrapper altogether.Testing
acpx kiro sessions newkiro-cli-chat acpprocess running (no orphans)