Skip to content

Stop the isolation boundary when cancellation is trapped before wait - #9

Merged
oakimov merged 3 commits into
mainfrom
cursor/isolate-trap-stop-cc36
Nov 10, 2026
Merged

oakimov merged 3 commits into
mainfrom
cursor/isolate-trap-stop-cc36

Conversation

@oakimov

@oakimov oakimov commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Summary

Compares open OCP #8 (the port of cursor-opencode-provider #177) with the provider follow-ups #178 and #179, and ports the shared harness behavior that was still missing.

  • #177 is already in fix: send one review credential on every gh call #8: one publication credential on every gh call in post, threads, and complete-resolutions.py. This branch does not repeat that change.
  • #178 is the necessary port. isolate-run.sh already forwarded TERM, INT, HUP, and QUIT and killed a session after ISOLATE_TERM_GRACE, but the grace loop ran only after wait. A bash trap taken between two commands does not interrupt the following wait, so a signal that arrived before the session leader was known, or just before wait, left the script blocked on a command that ignores TERM. The trap now runs the stop sequence itself and returns only when the leader is gone. isolated-check.sh still waits for that boundary before removing the archive and exits 128 plus the signal number. The review-eval ownership fixture creates its heartbeat once and appends without O_CREAT, so a write cannot recreate the file between unlink and rmdir.
  • #179 is not ported. It keeps the provider's plugin tests off the operator's Cursor credential store and the public network (preload, a fetch/net guard, host-cache restore, and stubbed model-discovery tests). This repository has no Cursor auth store, no live model discovery, and no --live path.

Product differences kept on purpose:

  • No scripts/live-test.sh, no check_run_live, and no CURSOR_API_KEY inside the boundary. Interactive stock-host acceptance stays outside the isolated check.
  • The session starter still restores SIGINT and SIGQUIT for a background job. That helper is unchanged.
  • SIGKILL of either script still cannot be forwarded. macOS still has no pid namespace, so a process that starts its own session inside sandbox-exec is not stopped with the boundary.

Test plan

  • bash -n scripts/isolate-run.sh scripts/isolated-check.sh
  • bunx tsc -p tsconfig.test.json --pretty false
  • bun test ./test/review-scripts.test.ts — 35 pass, 0 fail, including TERM before the session leader is known, TERM just before wait, a command that ignores TERM, a command that stops itself, and isolated-check.sh on SIGTERM and SIGINT
  • bun test ./test/review-eval.test.ts -t "settling runners" — 1 pass
Open in Web Open in Cursor 

cursoragent and others added 3 commits November 10, 2026 20:18
…wait

A bash trap taken between two commands does not interrupt the following
wait, so TERM sent only to isolate-run.sh before the session leader was
known, or just before wait, left the script blocked on a command that
ignores the signal. The trap now runs the stop sequence itself.

Co-authored-by: Oleksiy Akimov <oakimov@users.noreply.github.com>
@oakimov
oakimov merged commit 218169b into main Nov 10, 2026
5 checks passed
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.

2 participants