Skip to content

fix(cli): a signal during connect sends no lease request - #1482

Merged
V3RON merged 4 commits into
mainfrom
bug/1473
Nov 9, 2026
Merged

V3RON merged 4 commits into
mainfrom
bug/1473

Conversation

@V3RON

@V3RON V3RON commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1473

Status

Implement: done (3/3 green) Review: round 1, round 2 and a fix-check done, 0 findings Hardware: n/a Gate: not run
Next: gate

Done when:

  • A signal that reaches simlock lease while it connects sends no lease request and exits 0 (triage test "sends no lease request and exits 0 on $trigger while it connects"). — src/cli/lease-connect-signal.test.ts, SIGINT, SIGTERM and --bind-pid exit cases: green at 0bf4711, and red (sentRequests 1, exit 1) with the lease.ts change reverted

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 1.2M.
Runs: 9. Cost USD: 1.3733. Agent seconds: 1145.
Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

runLease now installs its termination handler before connecting to the daemon. If a signal or bound-process exit occurs while the command is connecting, tests verify that it exits with code 0 and sends no lease request. The CLI documentation describes termination behavior during connection and during a request.

Suggested reviewers: leonardoxr

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 0bf47

Termination during connection is handled as intended on the tested path. No actionable PR-introduced issue remains before merge.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly summarizes the main change: preventing a lease request when a signal arrives during connection.
Description check Passed The description explains the cancellation behavior and reports relevant tests for signals and parent-process exit during connection.
Linked Issues check Passed Issue #1473 requires a SIGTERM during initial connection to prevent the lease request and exit 0. runLease now installs the termination handler and abort controller before connectDaemonClient; ter…
Out of Scope Changes check Passed The CLI documentation update describes the new connection-phase behavior. The lease handling change and tests support issue #1473. No unrelated changes are present in the reviewed diff.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

Issue #1473 requires a SIGTERM during initial connection to prevent the lease request and exit 0. runLease now installs the termination handler and abort controller before connectDaemonClient; termination before a grant aborts the wait. The new lease-connect-signal.test.ts verifies SIGTERM and SIGINT, plus --bind-pid exit, during connection: no request is sent and the command exits 0. The changes meet the linked coding requirement.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

  • 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: d8596a9c-1c53-4416-b722-cc4976b329ce
Commits

Reviewing files that changed from the base of the PR and between 30f8fad and 0bf4711.

Files selected for processing: 3

  • src/cli/AGENTS.md
  • src/cli/commands/lease.ts
  • src/cli/lease-connect-signal.test.ts

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

@V3RON

V3RON commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 7879123
Round fix-check: 0bf4711
Round 2: 0bf4711

Runs: 9. Cost USD: 1.3733. Agent seconds: 1145.
Tokens input 154, output 36426, cache read 2080140, cache write 238458.
- build implementer: claude-sonnet-5-5 72 s $0.1086
- audit implementer: claude-sonnet-5-5 429 s $0.0903
- review 1 reviewer: claude-sonnet-5-5 219 s $0.1847
- review 1 spec: claude-sonnet-5-5 13 s $0.0654
- review 1 code both: claude-opus-5-5 146 s $0.4093
- review 1 claims: claude-sonnet-5-5 29 s $0.06
- fix implementer: claude-sonnet-5-5 129 s $0.2297
- review fix-check reviewer: claude-sonnet-5-5 55 s $0.101
- review 2 reviewer tests: claude-sonnet-5-5 53 s $0.1243
Finding outcomes: {}. Classes: {}.
{"findings":[]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 9, 2026 22:40
@V3RON
V3RON merged commit b3225c6 into main Nov 9, 2026
55 checks passed
@V3RON
V3RON deleted the bug/1473 branch November 9, 2026 22:47
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.

simlock lease ignores a SIGTERM in its first second, and the request it then queues outlives the process

1 participant