Skip to content

fix: restore --version and staged adapter shutdown fallback#41

Merged
osolmaz merged 1 commit intoopenclaw:mainfrom
osolmaz:fix/restore-version-and-graceful-shutdown
Mar 1, 2026
Merged

fix: restore --version and staged adapter shutdown fallback#41
osolmaz merged 1 commit intoopenclaw:mainfrom
osolmaz:fix/restore-version-and-graceful-shutdown

Conversation

@dutifulbob
Copy link
Contributor

Summary

Restore two regressions introduced during the #28 refactor:

  • bring back CLI --version output
  • restore staged adapter shutdown fallback in AcpClient.close()
    • close stdin first
    • wait briefly
    • send SIGTERM and wait
    • force SIGKILL if still running

Details

--version

  • reconnected commander version wiring with getAcpxVersion() in src/cli-core.ts
  • restored regression test asserting acpx --version prints package.json version

Graceful shutdown fallback

  • restored shutdown helpers in src/client.ts:
    • process-running detection
    • bounded wait-for-exit
    • staged signal escalation
  • kept explicit stdio handle destruction to avoid hung CLI exits
  • only unref() when process still has not exited after escalation
  • reintroduced mock-agent --ignore-sigterm mode and added CLI regression test verifying sessions ensure exits cleanly in that case

Validation

  • npm run lint
  • npm run typecheck
  • npm test

@osolmaz osolmaz merged commit 55265a9 into openclaw:main Mar 1, 2026
1 check passed
@osolmaz osolmaz deleted the fix/restore-version-and-graceful-shutdown branch March 1, 2026 18:56
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.

2 participants