Skip to content

fix: use kiro-cli-chat directly to prevent orphan child processes#124

Closed
vokako wants to merge 5 commits intoopenclaw:mainfrom
vokako:fix/kiro-orphan-process
Closed

fix: use kiro-cli-chat directly to prevent orphan child processes#124
vokako wants to merge 5 commits intoopenclaw:mainfrom
vokako:fix/kiro-orphan-process

Conversation

@vokako
Copy link
Contributor

@vokako vokako commented Mar 12, 2026

Problem

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 — the child process kiro-cli-chat continues running as an orphan.

These orphaned processes accumulate over time and cause resource conflicts, resulting in ACP_TURN_FAILED errors (exit code 1) on subsequent messages in persistent sessions. The first message in a session works fine, but follow-up messages fail because the stale kiro-cli-chat process 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:

-  kiro: "kiro-cli acp",
+  kiro: "kiro-cli-chat acp",

Related

Testing

  • Created persistent kiro session with acpx kiro sessions new
  • Sent multiple consecutive messages — all succeeded with session reuse
  • Verified only 1 kiro-cli-chat acp process running (no orphans)
  • Previously: 6+ orphan processes accumulated after a few session cycles

vokako and others added 5 commits March 12, 2026 17:21
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)
)

Bumps the development group with 4 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [lint-staged](https://github.com/lint-staged/lint-staged), [oxfmt](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxfmt) and [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint).


Updates `@types/node` from 25.3.5 to 25.4.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `lint-staged` from 16.3.2 to 16.3.3
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v16.3.2...v16.3.3)

Updates `oxfmt` from 0.36.0 to 0.37.0
- [Release notes](https://github.com/oxc-project/oxc/releases)
- [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxfmt/CHANGELOG.md)
- [Commits](https://github.com/oxc-project/oxc/commits/oxfmt_v0.37.0/npm/oxfmt)

Updates `oxlint` from 1.51.0 to 1.52.0
- [Release notes](https://github.com/oxc-project/oxc/releases)
- [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md)
- [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.52.0/npm/oxlint)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development
- dependency-name: lint-staged
  dependency-version: 16.3.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development
- dependency-name: oxfmt
  dependency-version: 0.37.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development
- dependency-name: oxlint
  dependency-version: 1.52.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@vincentkoc vincentkoc closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants