fix(cli): surface binary startup failures with actionable diagnostics - #220
Merged
tiann merged 1 commit intoFeb 27, 2026
Merged
Conversation
tiann
approved these changes
Feb 27, 2026
Unintendedz
referenced
this pull request
in Unintendedz/hapii
Mar 3, 2026
SeeFlowerX
pushed a commit
to SeeFlowerX/hapi
that referenced
this pull request
Apr 1, 2026
junmo-kim
added a commit
to junmo-kim/hapi
that referenced
this pull request
May 17, 2026
The line-array join used the two-character escape '\\n' instead of a real '\n', so every generated hapi-hook.ts was a single long line with literal backslash-n sequences. OpenCode's plugin loader treats that as a TypeScript syntax error and silently drops the plugin — meaning the HAPI hook channel has been inert since the initial OpenCode integration landed in tiann#220 (`feat: support opencode`, 2026-01-29). The bug went undetected because the storage scanner channel was still carrying messages until OpenCode migrated its on-disk storage to SQLite. PR tiann#589 (2026-05-15) has since restored that scanner channel for the user-facing flow; this commit independently restores the *intended primary* channel so HAPI no longer carries a permanently broken plugin generator. Adds a colocated unit test that pins down the format and guards against the same class of escape-confusion regressing again.
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.
Summary
cli/bin/hapi.cjswhen platform binary exits via signal or non-zero statusWhy
Issue #212 reports that wrapper failures were effectively silent in real-world crash cases (e.g.
SIGILL), making root-cause diagnosis hard.This change keeps behavior backward-compatible for successful runs while making failures immediately debuggable.
Testing
cd cli && bun run tools:unpackcd cli && bun run test:wincd cli && bun run typecheckCloses #212