Add runnable persona bridge - #33
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bc84e5296
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cancelled = true; | ||
| child.kill('SIGTERM'); | ||
| }; | ||
| options.signal?.addEventListener('abort', abort, { once: true }); |
There was a problem hiding this comment.
Handle pre-aborted signals before spawning child
spawnCapture only subscribes to 'abort' events, but it never checks options.signal?.aborted before spawning. If callers pass an already-aborted signal (or a merged signal that is already aborted), Node does not re-fire the abort event for this late listener, so the harness process still starts and can run side effects even though cancellation was requested up front.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 526c16c. sendMessage() now detects the merged signal before materializing config files or spawning, returns cancelled, preserves the abort reason, and has a regression test that verifies the fake harness never runs when the signal is already aborted.
| ? setTimeout(() => { | ||
| timedOut = true; | ||
| child.kill('SIGTERM'); | ||
| }, options.timeoutSeconds * 1000) |
There was a problem hiding this comment.
Escalate timeout cancellation when child ignores SIGTERM
The timeout path marks timedOut and sends only SIGTERM, then waits for 'exit'/'error' to resolve. If the harness traps or ignores SIGTERM, the promise can hang indefinitely, so timeoutSeconds no longer guarantees completion and callers can block forever. A forced follow-up kill (or watchdog) is needed to make timeout behavior reliable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 526c16c. spawnCapture() now starts a forced SIGKILL watchdog after the timeout SIGTERM, clears it on normal exit, and has a regression test with a fake harness that ignores SIGTERM so timeout still resolves.
Summary
Validation