fix: use kiro-cli-chat directly to prevent orphan child processes#129
fix: use kiro-cli-chat directly to prevent orphan child processes#129vokako wants to merge 2 commits 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
# Conflicts: # skills/acpx/SKILL.md
Triage resultHuman attention: Quick readThis PR is a focused bug fix: it changes the built-in The initial merge conflict against The remaining blocker in this flow is validation: the fix was not proven locally here because no targeted repro/test command could be derived from the repo state for this Kiro-specific behavior. IntentChange Underlying problem: Why
Codex review
CI/CD
RecommendationEscalate to a human. The code change is small and plausibly correct, but someone needs to decide whether normal repo review/CI is sufficient here or whether this PR should get manual Kiro-specific verification before landing:
|
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)