Skip to content

fix(ios): a simctl command that ignores SIGTERM at its limit is sent SIGKILL - #2024

Merged
V3RON merged 3 commits into
mainfrom
bug/1980
Dec 2, 2026
Merged

V3RON merged 3 commits into
mainfrom
bug/1980

Conversation

@V3RON

@V3RON V3RON commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1980

Status

Implement: fix done Review: fix-check at ce53643, passed Hardware: n/a Gate: red 1x
Next: the gate again
Ledger:

  • R1, spec+code+claims, src/drivers/ios/command-run.ts:27 comment called the runner timeout a backstop while spawn reads no timeoutMs; impacts claims (mechanical comment hunk); outcome fixed; fix ce53643; verified by coordinator at ce53643
    State: {"issue":1980,"branch":"bug/1980","pr":2024,"last":"5d77f58fa276","done":"gate","mode":"fix","built":1,"audited":true,"assessment":"complete","rounds":["1:08548e04e840fb901bcb3cf9b270f5b0566c289c","fix-check:review:ce536438a03784afaa1466846ece7b08f2b43526"],"round":"fix-check","commit":"ce536438a03784afaa1466846ece7b08f2b43526","checkedBase":"9b28b4526b5f9cc2a031658bf7af874cc2ed4c9a","reviewBase":"9b28b4526b5f9cc2a031658bf7af874cc2ed4c9a","lenses":0,"findings":"/private/tmp/claude-501/-Users-szymon-chmal--t3-worktrees-pitlane-t3-d08d0e5e-bc7b7183bf0c6f75/b2b62600-7243-4fa0-a9f5-080dd01e100b/scratchpad/findings-2024.json","gate":{"red":1,"fixes":0,"refusal":"not merged: CI not green on PR fix(ios): a simctl command that ignores SIGTERM at its limit is sent SIGKILL #2024: fail Quality;fail Unit tests (Windows) (1/3);","merged":null},"unknown":["src/release-pack.test.ts > the Release workflow's Pack step (.github/workflows/release.yml) > packs simlock and @simlock/e2e at one version, the second with its built files and no test file, and lists both in SHA256SUMS.txt (CI run 46845597987)"]}

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 1. Tokens: 0.8M.
Runs: 8. Cost USD: 1.2469. Agent seconds: 560.

Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The iOS command runner now sends SIGTERM at timeout and schedules SIGKILL 10 seconds later. It cancels the SIGKILL timer if the process settles first. Late-answer commands use the same sequence after late.killAfterMs. Tests cover simctl list and clone, including commands that ignore or respond to SIGTERM.

Severity of issue fixed: Low

Merge Risk: Minimal · up to ce536

iOS simctl commands that ignore SIGTERM are now force-killed 10 seconds after the timeout, which fixes the hung-process case. No concrete merge-blocking risk was found in the supplied changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: a simctl command that ignores SIGTERM at its limit now receives SIGKILL. The raw summary confirms runCommand sends SIGTERM at the timeout and schedules SIGKILL afte…
Linked Issues check Passed [#1980] The issue requires that a command ignoring SIGTERM be escalated to SIGKILL, and that the runner-timeout comment not rely on a backstop. At head ce53643, terminate() in src/drivers/ios/comm…
Out of Scope Changes check Passed The diff from merge base dead1fb to head changes src/drivers/ios/command-run.ts only. It adds the SIGKILL_GRACE_MS constant, a signal helper, a terminate function that sends SIGTERM then SIGKI…
Description check Passed The description is related to the changeset. It names issue #1980 and describes a status ledger for the fix. It also notes a claims-review fix to the command-run comment in src/drivers/ios/command-run…
Full details: Title check

Explanation

The title names the primary change: a simctl command that ignores SIGTERM at its limit now receives SIGKILL. The raw summary confirms runCommand sends SIGTERM at the timeout and schedules SIGKILL after a 10-second grace period, and the linked issue #1980 describes this same gap. The title is specific and matches the changeset.

Full details: Linked Issues check

Explanation

[#1980] The issue requires that a command ignoring SIGTERM be escalated to SIGKILL, and that the runner-timeout comment not rely on a backstop. At head ce53643, terminate() in src/drivers/ios/command-run.ts sends SIGTERM and arms a SIGKILL_GRACE_MS (10 s) timer that sends SIGKILL, canceled when waited settles. terminate runs on the plain timeout path and on the late-answer kill timer. The comment at line 27 now states that spawn reads no timeoutMs and that the timers end the command. The PR summary reports a test that checks SIGKILL after 10 s for SIGTERM-ignoring processes and no pending timers. The code still passes timeoutMs to spawn. The issue calls this value misleading, and the PR documents it instead of removing it. This is a judgment call, and it does not block the core requirements. Other evidence: the diff from merge base dead1fb to head shows only these changes in command-run.ts. I did not inspect the test file diff directly.

Full details: Out of Scope Changes check

Explanation

The diff from merge base dead1fb to head changes src/drivers/ios/command-run.ts only. It adds the SIGKILL_GRACE_MS constant, a signal helper, a terminate function that sends SIGTERM then SIGKILL, and a comment update. All of these serve the #1980 objective. The PR summary also lists a supporting test for list and clone SIGTERM/SIGKILL behavior, which also serves that objective. No unrelated change appears in the evidence reviewed. The test file diff was not inspected directly, so its content rests on the summary.

Full details: Description check

Explanation

The description is related to the changeset. It names issue #1980 and describes a status ledger for the fix. It also notes a claims-review fix to the command-run comment in src/drivers/ios/command-run.ts, which matches the changed files. It does not summarize the SIGTERM and SIGKILL behavior change itself, but it is not off-topic.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: aad474cf-5096-4f99-a8dc-0c21e4d1a25b
Commits

Reviewing files that changed from the base of the PR and between 9b28b45 and ce53643.

Files selected for processing: 2

  • src/drivers/ios/command-run.ts
  • src/drivers/ios/index-seed-sources.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@V3RON

V3RON commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 08548e0
Round fix-check: ce53643 review

Runs: 8. Cost USD: 1.2469. Agent seconds: 560.
Tokens input 120, output 26347, cache read 1541216, cache write 215898.
- build implementer: claude-sonnet-5-5 77 s $0.1358
- audit implementer: claude-sonnet-5-5 47 s $0.108
- review 1 reviewer: claude-sonnet-5-5 203 s $0.1057
- review 1 spec: claude-sonnet-5-5 14 s $0.0613
- review 1 code behaviour: claude-opus-5-5 127 s $0.5788
- review 1 claims: claude-sonnet-5-5 30 s $0.1123
- fix 1 implementer: claude-sonnet-5-5 31 s $0.0824
- review fix-check reviewer: claude-sonnet-5-5 31 s $0.0626
Finding outcomes: {"fixed":1}. Classes: {"comment claims runner timeout backstop":1}.
{"findings":[{"id":"R1","role":"claims","class":"comment claims runner timeout backstop","outcome":"fixed","path":"src/drivers/ios/command-run.ts:27","round":"1","fix":"ce536438a03784afaa1466846ece7b08f2b43526"}]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review December 2, 2026 08:55
@V3RON
V3RON merged commit af8054f into main Dec 2, 2026
86 of 88 checks passed
@V3RON
V3RON deleted the bug/1980 branch December 2, 2026 09:14
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.

iOS runCommand passes timeoutMs to spawn, which ignores it, and its comment relies on that backstop

1 participant