fix(eval): swallow microsandbox 'egress frame too large' so the eval doesn't die mid-run#4
Closed
nickwinder wants to merge 1 commit into
Closed
fix(eval): swallow microsandbox 'egress frame too large' so the eval doesn't die mid-run#4nickwinder wants to merge 1 commit into
nickwinder wants to merge 1 commit into
Conversation
…doesn't die mid-run microsandbox's egressIntercept() runs its event-pump loop as a fire-and-forget async IIFE with try/finally — no catch. When the native binding throws "egress frame too large" (the protocol parser hit a frame above its internal buffer), the rejection escapes as unhandledRejection and crashes the parent node process, taking out the whole eval. We've reproduced this consistently on TC-005 with the Nutrient Web SDK suite — TC-001 finishes, then the next test's executor sandbox triggers the bug and the entire eval dies before any judging happens. Install a process-level unhandledRejection handler at the CLI entry point that ONLY catches errors with code === 'GenericFailure' AND message matching /egress frame too large/. Re-throw everything else so genuine unhandled rejections still crash loudly. Egress logging for that one test case stops (it's observability, not correctness — the eval can still execute, snapshot, and judge). After this fix the same TC-001+TC-005 run completes and both produce judge results.
Contributor
Author
|
not required after fixing up claude oauth sessions |
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.
Why
microsandbox'segressIntercept()runs its event-pump loop as a fire-and-forget async IIFE withtry/finally— nocatch. When the native binding throws"egress frame too large"(protocol parser hit a frame above its internal buffer), the rejection escapes asunhandledRejectionand crashes the parent node process, taking out the whole eval. We've reproduced this consistently mid-suite — early test cases finish, then a later test's executor sandbox triggers the bug and the eval dies before any judging happens.Summary
unhandledRejectionhandler at the CLI entry point that only catches errors withcode === 'GenericFailure'AND message matching/egress frame too large/. Re-throw everything else so genuine unhandled rejections still crash loudly.Single-file change to
src/index.ts(+18 lines, no test changes — the bug originates in the native binding, hard to reproduce deterministically in unit tests).