Skip to content

fix: ensure graceful shutdown in non-interactive chat mode#181

Merged
avoidwork merged 1 commit into
mainfrom
fix/chat-mode-shutdown
Jun 12, 2026
Merged

fix: ensure graceful shutdown in non-interactive chat mode#181
avoidwork merged 1 commit into
mainfrom
fix/chat-mode-shutdown

Conversation

@avoidwork

Copy link
Copy Markdown
Owner

Description

The --chat mode was falling through after the conversation completes without calling the shutdown handler. This left the session unsaved, the GC manager running, and telemetry unflushed. Extracted the shutdown logic into a named runShutdown() function and call it explicitly before process.exit(0).

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • CI / build / tooling

Testing

All existing tests pass. The change extracts existing shutdown logic into a named function (no new behavior introduced) and calls it in the --chat mode path. No new functions require new unit tests — the existing shutdown handler tests cover the extracted logic.

Coverage

  • 100% line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with 100% line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

The --chat mode was falling through without calling the shutdown
handler, leaving the session unsaved, GC manager running, and
telemetry unflushed. Extracted the shutdown logic into a named
runShutdown() function and call it explicitly before process.exit(0).
@avoidwork avoidwork self-assigned this Jun 12, 2026
@avoidwork avoidwork merged commit 44c5b38 into main Jun 12, 2026
3 checks passed
@avoidwork avoidwork deleted the fix/chat-mode-shutdown branch June 12, 2026 01:23
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.

1 participant