Skip to content

Restore stdin EOF for repository lifecycle scripts - #3556

Merged
ymichael merged 1 commit into
mainfrom
bb/fixer-restore-eof-for-repository-setup-and-teard-thr_rs8vd9nxbn
Sep 12, 2026
Merged

Restore stdin EOF for repository lifecycle scripts#3556
ymichael merged 1 commit into
mainfrom
bb/fixer-restore-eof-for-repository-setup-and-teard-thr_rs8vd9nxbn

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Repository setup and teardown scripts were launched with piped stdin, but the host daemon never wrote to or closed that pipe. Any noninteractive hook that read stdin—for example, cat >/dev/null before doing its work—waited until the lifecycle timeout. Setup could prevent an environment from becoming ready, while teardown could skip cleanup commands after the read.

What changed

  • Launch repository lifecycle scripts with the existing output-only process helper, which supplies immediate stdin EOF while preserving piped stdout and stderr.
  • Apply the same behavior to setup and teardown through their shared runner.
  • Preserve contributed environment variables, streamed UTF-8 output, timeouts, cancellation, and process-group cleanup.
  • No public API, CLI, configuration, or server/daemon wire contract changed. No protocol-version bump is needed.

How you verified

  • Added setup and teardown regressions that read stdin before writing a marker, emit split UTF-8 output, and write stderr. Both fail before the fix and pass after it.
  • pnpm exec turbo run test --filter=@bb/host-daemon --force -- src/environment-lifecycle-script.test.ts src/operation-environment.test.ts test/command/environment-hook.test.ts: 20/20 passed.
  • pnpm exec turbo run build typecheck --filter=@bb/host-daemon --force: passed.
  • Targeted formatting and git diff --check passed.
  • On a real Modal sandbox, repository setup received EOF, a real Codex agent completed its turn, and a separate disposable worktree's teardown received EOF and wrote its cleanup marker. The sandbox was suspended after verification.

Follow-up to #3274.

AGENT GENERATED

@ymichael
ymichael merged commit 1ebdc56 into main Sep 12, 2026
16 checks passed
@ymichael
ymichael deleted the bb/fixer-restore-eof-for-repository-setup-and-teard-thr_rs8vd9nxbn branch September 12, 2026 03:16
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