Skip to content

fix(cli): surface binary startup failures with actionable diagnostics - #220

Merged
tiann merged 1 commit into
tiann:mainfrom
liuxiaopai-ai:fix/issue-212-binary-failure-reporting
Feb 27, 2026
Merged

fix(cli): surface binary startup failures with actionable diagnostics#220
tiann merged 1 commit into
tiann:mainfrom
liuxiaopai-ai:fix/issue-212-binary-failure-reporting

Conversation

@liuxiaopai-ai

Copy link
Copy Markdown
Contributor

Summary

  • fix silent failure mode in cli/bin/hapi.cjs when platform binary exits via signal or non-zero status
  • print the exact executed command + signal/status/message before exiting
  • preserve child exit semantics (exit with child status when available)
  • refactor launcher into testable functions and add focused unit tests

Why

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:unpack
  • cd cli && bun run test:win
  • cd cli && bun run typecheck

Closes #212

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings: none.
Residual risk: signal/exit propagation path not covered by tests; only helper unit tests.
Testing: not run (automation).

@tiann
tiann merged commit 1f958f4 into tiann:main Feb 27, 2026
2 checks passed
jasonczc pushed a commit to jasonczc/haqi that referenced this pull request Mar 15, 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.
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.

If the underlyig hapi binary fails to start it will silently exit

2 participants