Skip to content

Comments

refactor: graceful exit batch stop#1656

Merged
samuv merged 1 commit intomainfrom
batch-stop
Feb 17, 2026
Merged

refactor: graceful exit batch stop#1656
samuv merged 1 commit intomainfrom
batch-stop

Conversation

@samuv
Copy link
Collaborator

@samuv samuv commented Feb 16, 2026

as per title a little refactor using the batch api endpoint instead of calling stop on each server when we do the graceful exit

@samuv samuv self-assigned this Feb 16, 2026
Copilot AI review requested due to automatic review settings February 16, 2026 16:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the app’s graceful-exit shutdown flow to stop running servers via the ToolHive bulk stop endpoint (batch API) instead of issuing per-server stop requests, and updates the existing Vitest coverage accordingly.

Changes:

  • Switch stopAllServers to call postApiV1BetaWorkloadsStop once with a names list.
  • Remove per-server stop fan-out (Promise.allSettled) and associated aggregated failure reporting.
  • Update graceful-exit tests to validate the new batch-stop request shape and error behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
main/src/graceful-exit.ts Replaces per-server stop calls with a single bulk stop request and reuses the same polling-to-final-state flow.
main/src/tests/graceful-exit.test.ts Updates mocks/expectations to assert a single bulk stop call (body.names) and aligns failure expectations with the new behavior.

@samuv samuv merged commit 3e6b0d9 into main Feb 17, 2026
22 of 23 checks passed
@samuv samuv deleted the batch-stop branch February 17, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants