Skip to content

[bug] On Windows, runCommandHook in LIFEOS/CODEX/Bridge.ts does not stop at the hook… #2830

Open

Description

@donatellobruno

What happened

On Windows, runCommandHook in LIFEOS/CODEX/Bridge.ts does not stop at the hook timeout. The timer kills Git sh.exe, but the hook child process (bun, sleep) keeps running and holds the stdout and stderr pipes, so the close event fires only when the child ends and the bridge waits with it. Measured: a hook running sleep 8 with timeout 2 took 8.1 s. A local patch fixed it: on win32, run taskkill /PID /T /F before child.kill and resolve as timed out (2.1 s with sleep 60, no leftover processes).

Summary

On Windows, killing the hook's sh.exe does not kill the process it started, and that child keeps the pipes open, so runCommandHook resolves only when the child exits on its own. A hung hook holds the Codex bridge past its timeout, up to Codex's own hook timeout.

Repro: a SessionStart hook sleep 8 with timeout: 2 passed to bridge() through deps.settings takes about 8 s instead of about 2 s.

Fix that worked locally: in the timeout handler, on win32 run taskkill /PID <child.pid> /T /F before child.kill() (while the parent link still exists), then resolve as timed out without waiting for close. With sleep 60 and timeout: 2 the bridge returned in 2.1 s and no sleep process was left.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions