fix(agent-setup): detect short Codex sessions sooner with GNU tail

PR
9h ago
+12-3

Why

On Linux, a short Codex session can start and exit between two GNU tail -F polls. When the watcher misses the Start event, Paradev can show the wrong session status.

Change

Poll every 50 ms with GNU tail. This narrows the window in which a short session can be missed. Other tail implementations keep their existing arguments. The session-log tests check for exactly one Start event, including on the GNU path. The Linux verification run passed all 31 tasks on this PR’s commit.

The diff-comment routing fix is tracked separately in #9606.

Verification

  • Split PR head c9fc751: in an isolated non-root ARM64 Debian container with Ubuntu 24.04 login-shell PATH behavior, Node 22, and Bun 1.4.3, the complete turbo test test:integration:terminal --continue --force --concurrency=4 --log-order=stream run passed 31/31 tasks with no cache. This is a local synthetic run, not GitHub CI.

  • On macOS, bun test packages/agent-setup/src/agent-wrappers.test.ts: 95 passed, including both session-log tests and the unrelated-session isolation test. Bun 1.4.4; macOS uses non-GNU tail.

  • Before splitting this change, the combined tree passed turbo test test:integration:terminal --continue --force --concurrency=4 in an isolated ARM64 Debian container using Ubuntu 24.04 shell settings, Node 22, and Bun 1.4.3: 31/31 tasks, no cache. This earlier run was not a GitHub Actions run; the separate split-branch run is recorded above.

  • On the split branch, the affected template and tests are unchanged from that combined tree. GitHub CI is needed to validate the split on its runners.


Summary by cubic

Fixes GNU tail -F missing Start events for short Codex sessions on Linux by reducing its polling interval from the default to 50 ms. Non-GNU tail implementations, like macOS, keep their existing behavior.

The session-log tests now assert exactly one Start event is emitted.

Summary by CodeRabbit

  • Bug Fixes
    • Session-start events are detected more frequently on systems with GNU coreutils, helping session updates appear sooner. Other supported tail implementations continue to work without the additional polling option.