feat: improve spawn error handling and reporting across full stack#249
Merged
tiann merged 4 commits intotiann:mainfrom Mar 9, 2026
Merged
feat: improve spawn error handling and reporting across full stack#249tiann merged 4 commits intotiann:mainfrom
tiann merged 4 commits intotiann:mainfrom
Conversation
- Return error result instead of throwing in apiMachine spawn handler - Add lastSpawnError field to RunnerState for persistent error tracking - Add error awaiter system for early process exit/error detection before webhook - Build detailed webhook failure messages with exit code, signal, and stderr tail - Report spawn outcomes to hub via runner state updates - Handle more spawn result types in rpcGateway with better error messages - Display runner last spawn error in web UI (NewSession & SpawnSession) - Extract shared formatRunnerSpawnError utility to avoid duplication Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use `type === 'error'` instead of `type !== 'success'` to properly narrow the discriminated union, allowing TypeScript to infer errorMessage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fce96c2 to
4b81896
Compare
Owner
|
@tiann review |
|
I found 1 blocking issue.
Validation: could not run HAPI Bot |
jasonczc
pushed a commit
to jasonczc/haqi
that referenced
this pull request
Mar 15, 2026
…iann#249) * feat: improve spawn error handling and reporting across full stack - Return error result instead of throwing in apiMachine spawn handler - Add lastSpawnError field to RunnerState for persistent error tracking - Add error awaiter system for early process exit/error detection before webhook - Build detailed webhook failure messages with exit code, signal, and stderr tail - Report spawn outcomes to hub via runner state updates - Handle more spawn result types in rpcGateway with better error messages - Display runner last spawn error in web UI (NewSession & SpawnSession) - Extract shared formatRunnerSpawnError utility to avoid duplication Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(cli): narrow spawnResult type check to fix TS2339 error Use `type === 'error'` instead of `type !== 'success'` to properly narrow the discriminated union, allowing TypeScript to infer errorMessage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit 4716d31)
doraemonkeys
added a commit
to doraemonkeys/hapi
that referenced
this pull request
Mar 16, 2026
feat: improve spawn error handling and reporting across full stack (tiann#249) Adapted to fork's sessionManager architecture: - pidToErrorAwaiter + buildWebhookFailureMessage → sessionManager.ts - SpawnOutcomeReporter injected via setSpawnOutcomeReporter() - rpcGateway: merged requestToApproveDirectoryCreation + obj.message fallback
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.
Create Session 时,现在的代码如果失败了不会报具体的原因,这个PR能够显示具体的原因,如Failed to spawn HAPI process - no PID returned (cwd=/home/xxx/test_dir; EACCES: permission denied, posix_spawn '/home/xxx/hapi/cli/dist-exe/bun-linux-x64-baseline/hapi')