Repository navigation
Stop ewiz-mcp crashing on SIGTERM in release builds - #57
Merged
Merged
Conversation
The 0.18.5 fix rebound the captured global, but the crash came from the handler closure itself: written in main.swift's top-level code, it inherits the main actor under the release SDK (macOS 26.5), and the runtime's isolation check traps on the signal source's global queue. Newer local SDKs don't, so local builds never reproduced it. Mark the handler @sendable inside a plain function so it is nonisolated on every toolchain, and check the packaged binary exits cleanly on SIGTERM in the release job.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.18.5 and 0.18.6 still ship an
ewiz-mcpthat crashes (EXC_BREAKPOINT indispatch_assert_queue) whenever an agent session ends. Reproduced against the installed 0.18.6:kill -TERM→ exit 133.Cause: the signal handler closure is written in
main.swifttop-level code, so under the release SDK (macOS 26.5,macos-26runner) it inherits the main actor, and the runtime's isolation check traps on the signal source's global queue. #49 changed what the closure captured, not the closure's isolation. Local builds (SDK 27.0) don't infer the isolation, so they never crashed.Fix: the handler is an explicit
@Sendableclosure inside a plain function, so it's nonisolated on every toolchain.Guard:
release.ymlnow SIGTERMs the packageddist/eWiz.app/Contents/MacOS/ewiz-mcpand fails the release if it doesn't exit 0, so this is checked on the exact toolchain that ships.Tested locally: SIGTERM/SIGINT/SIGHUP all exit 0; stdin-close path still serves and exits.