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

Đang mở Phù hợp với người mới
#2,830 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, typescript
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu tại runCommandHook trong LIFEOS/CODEX/Bridge.ts và đọc trình xử lý timeout cùng với listener close mà hiện quyết định thời điểm promise được resolve. Tái hiện bằng cách truyền một hook SessionStart sleep 8 với timeout: 2 qua bridge() thông qua deps.settings và đo thời gian gọi. Bản sửa là của người báo cáo: trên win32, chạy taskkill /PID <child.pid> /T /F trong khi liên kết parent vẫn còn tồn tại, sau đó resolve là timeout mà không chờ close. Hoàn tất nghĩa là bridge trả về gần timeout trên Windows và không còn tiến trình con nào bị bỏ lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
19.8k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của danielmiessler/LifeOS

Tất cả issue của danielmiessler/LifeOS

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.