fix(#2148): thread signal-aware context into sandbox exec - #2182
Conversation
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
Site previewPreview: https://540f7611-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 3:15 PM UTC · Completed 3:23 PM UTC |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ReviewFindingsLow
Previous runReviewFindingsHigh
Medium
Low
Previous run (2)ReviewFindingsLow
Previous runReviewFindingsMedium
Low
Previous run (3)ReviewFindingsLow
Previous run (4)ReviewFindingsLow
Previous run (5)ReviewFindingsMedium
Low
Previous run (6)ReviewFindingsLow
|
|
/fs-fix address the code coverage and also the review issues. |
|
🤖 Finished Fix · ✅ Success · Started 4:01 PM UTC · Completed 4:09 PM UTC |
🔧 Fix agent — iteration 1 (human-triggered)Addressed 2 of 3 coverage/review items: updated stale plan document signature and added ExecStreamReader unit tests. cli/run.go and runtime/claude.go coverage requires e2e tests. Fixed (2):
Disagreed (1):
Tests: passed Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 4:11 PM UTC · Completed 4:28 PM UTC |
f1d6f52 to
e423b9e
Compare
|
🤖 Finished Review · ✅ Success · Started 4:59 PM UTC · Completed 5:08 PM UTC |
e423b9e to
a0babd6
Compare
|
🤖 Finished Review · ✅ Success · Started 5:23 PM UTC · Completed 5:37 PM UTC |
a0babd6 to
9d4f143
Compare
|
🤖 Review · Started 5:41 PM UTC |
ExecStreamReader created its own context.WithTimeout from context.Background(), disconnecting it from the CLI's signal-aware context. When a workflow was cancelled during agent execution, the subprocess continued running and the status comment defer never fired, leaving it stuck at "Started". Wire the parent context through Runtime.Run and into ExecStreamReader so SIGTERM/SIGINT cancellation propagates into the sandbox subprocess. This lets execCmd.Wait() return promptly on cancellation, allowing runAgent's defer to post the "Cancelled" status comment. Changes: - sandbox.ExecStreamReader: accept ctx parameter, use as parent for WithTimeout instead of context.Background() - sandbox.ExecContext: new context-aware variant of Exec - runtime.Runtime.Run: add ctx parameter to interface - runtime.ClaudeRuntime.Run: forward ctx to ExecStreamReader - cli.runAgent: pass signal-aware ctx to rt.Run Closes #2148 Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
9d4f143 to
7006fa2
Compare
|
🤖 Finished Review · ✅ Success · Started 5:45 PM UTC · Completed 5:54 PM UTC |
|
🤖 Finished Retro · ✅ Success · Started 11:46 AM UTC · Completed 12:02 PM UTC |
Retro: PR #2182 — thread signal-aware context into sandbox execWorkflow: Issue #2148 → triage → code → 6 reviews + 2 fix attempts → merged in ~29 hours. What happened: The code agent produced a clean initial PR. After a human-triggered Reviews 2 and 3 missed these out-of-scope workflow changes entirely, only flagging test adequacy. Review 4 finally caught the protected-path violation and requested changes. The human had to manually revert the unrelated changes. Total cost: 2 extra review cycles, 1 failed fix attempt, and human intervention. Existing coverage: Several open issues track related improvements:
New proposal: One proposal filed for a gap not covered by existing issues — preventing the fix agent from modifying protected-path files unless explicitly directed to by review findings. Proposals filed
|
ExecStreamReader created its own context.WithTimeout from context.Background(), disconnecting it from the CLI's signal-aware context. When a workflow was cancelled during agent execution, the subprocess continued running and the status comment defer never fired, leaving it stuck at "Started".
Wire the parent context through Runtime.Run and into ExecStreamReader so SIGTERM/SIGINT cancellation propagates into the sandbox subprocess. This lets execCmd.Wait() return promptly on cancellation, allowing runAgent's defer to post the "Cancelled" status comment.
Changes:
parent for WithTimeout instead of context.Background()
ExecStreamReader
Closes #2148
Post-script verification
agent/2148-thread-cancel-context)b20e9f9cb36a09017ee59c770cd2b76378b0fdfd..HEAD)