Skip to content

[codex] capture stdin before runner compile#30

Merged
DorianZheng merged 1 commit intomainfrom
codex/capture-stdin-before-runner-compile
Apr 10, 2026
Merged

[codex] capture stdin before runner compile#30
DorianZheng merged 1 commit intomainfrom
codex/capture-stdin-before-runner-compile

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

This change fixes a BoxLite startup regression where the agent container could fail with Failed to parse input: Unexpected end of JSON input before the runner started.

What changed

  • capture stdin into /tmp/input.json before any entrypoint startup work
  • keep the runner recompilation step after stdin has already been preserved
  • add a regression test that asserts the Dockerfile entrypoint captures stdin before invoking npx tsc

Root cause

The entrypoint was recompiling the mounted runner source before reading stdin. In the BoxLite execution path, that startup ordering could leave the runner reading an empty or truncated input stream, which then failed at JSON.parse(stdinData).

Impact

This makes container startup deterministic for BoxLite-backed runs and prevents the main failure mode reported in the box log.

Validation

  • npm test -- src/container-image.test.ts src/container-runner.test.ts

@DorianZheng DorianZheng marked this pull request as ready for review April 10, 2026 06:14
@DorianZheng DorianZheng merged commit a74ce4e into main Apr 10, 2026
2 checks passed
@DorianZheng DorianZheng deleted the codex/capture-stdin-before-runner-compile branch April 10, 2026 06:15
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.

1 participant