fix: accept empty Pi completions and stabilize CI - #32
Merged
Conversation
Owner
Author
|
Implemented both review findings in separate commits:
Validation:
Both findings addressed; none deferred. Retained projection remains limited to 4 MiB and parser nesting to 256 levels. Oversized final messages and malformed records remain failures. CI run |
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.
Pi can finish artifact-producing work successfully with an empty final assistant message. Headless treated this as
could not extract final messageand returned exit 1. This stopped learned-optimizer job 79706 during task design, although Pi exited 0 after writingtask_design.json.This change observes bounded native Pi JSONL output before capture truncation. An explicit normal terminal completion preserves an empty final answer across plain, debug, raw JSON, SDK, session persistence, and run coordination. Usage remains available; SDK results contain
finalMessage: "". Native errors, nonzero exits, and incomplete lifecycles still fail, even when earlier progress text exists. Empty replies also clear stale messages on reused run nodes. Artifact validation and any subsequent repair remain the caller's responsibility.The failing main CI run (34347389524, Node 24) was a test ordering race: an already-running
has-sessionprobe could log after successfulkill-sessioncleanup. The fixture now deterministically exercises that ordering and checks the targeted cleanup and SIGTERM outcome. A separate test fix isolates the stuck-server fixture from host Codex history; a real-home scan took 20 seconds before its deadline began. Neither fix relaxes the cleanup timeout.Validation:
npm run check: 705 passed, 3 skipped;npm run pack:checkpassed.Three logical commits separate the CI ordering fix, test environment isolation, and Pi completion fix. The saved design still requires normal structural validation; this change makes that workflow reachable rather than declaring the artifact valid.