Skip to content

refactor(daemon): the socket's pass-through operations sit in one set - #1851

Merged
V3RON merged 4 commits into
mainfrom
refactor/1441
Nov 25, 2026
Merged

V3RON merged 4 commits into
mainfrom
refactor/1441

Conversation

@V3RON

@V3RON V3RON commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1441

Status

Implement: done (refactor, mutation 0 alive) Review: round 1 + fix-check, 1 finding fixed Hardware: n/a Gate: not run
Next: gate

Assumptions

  • Assumption: where the guard sits — inside the default arm, before the UNKNOWN_REQUEST throw, so the nine remaining arms stay as they were.
  • Assumption: how to run mutation when the the data directory tests call process.umask(), which Stryker's worker threads refuse — skipped them in vitest.mutate.config.ts locally for the run only, not committed.

Done when

  • grep -cE 'case "' src/daemon/server-requests.ts prints 9 (46 at 200afe5, minus 37). — ran on 81f7f7a: prints 9
  • PASSTHROUGH_OPERATIONS has one definition, in src/daemon/server-requests.ts, holding the 37 names above. — git grep on 81f7f7a: one definition (server-requests.ts:23); names checked by the review's socket probe
  • grep -rn 'handleRequest' src/daemon/ prints nothing. — ran on 81f7f7a: no match
  • No comment in src/daemon/server-requests.ts says the switch is the socket's whole surface. — claims review round 1 and fix-check at 81f7f7a
  • pnpm check passes. — CI on the head, required by the merge gate

Review

Spec review: skipped. Code review: 1 blocking, 1 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 1.7M.
Runs: 6. Cost USD: 2.6322. Agent seconds: 4827.

Assessment: complete

Refactor check

Tests: 0 before, 0 after.
Mutation: 135 mutants on 11 changed ranges; 0 alive.

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The daemon request handler now stores ordinary dispatcher-handled operation names in PASSTHROUGH_OPERATIONS and routes matching request types through a shared default branch. Connection-specific request cases remain explicit, and unknown request types still produce UNKNOWN_REQUEST. Comments in the daemon request handler and related server files now refer to ConnectionRequests.handle.

Suggested reviewers: leonardoxr

Merge Risk: Minimal · up to 81f7f

This refactor groups the daemon socket's ordinary pass-through operations into a single set without intended behavior change. No concrete defect was found, so the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the socket's pass-through operations are moved into one set (PASSTHROUGH_OPERATIONS in src/daemon/server-requests.ts). The raw summary and objectives confirm that 37 o…
Description check Passed The description relates directly to the changeset. It cites Closes #1441, states that the refactor is done, and lists completion checks such as the single PASSTHROUGH_OPERATIONS definition, the nine r…
Linked Issues check Passed [#1441] Checked src/daemon/server-requests.ts at the reviewed head (81f7f7a). The module-private PASSTHROUGH_OPERATIONS: ReadonlySet<OperationName> holds exactly the 37 names listed in the issue. …
Out of Scope Changes check Passed The whole-PR diff (merge base 200afe5 to head 81f7f7a), as summarized, touches only src/daemon/server-requests.ts (code change), src/daemon/server-options.ts (one comment), and src/daemon/server.t…
Full details: Title check

Explanation

The title names the main change: the socket's pass-through operations are moved into one set (PASSTHROUGH_OPERATIONS in src/daemon/server-requests.ts). The raw summary and objectives confirm that 37 one-call switch arms were consolidated into this set, so the title matches the changeset. It is a refactor, and the title says so with the conventional prefix.

Full details: Description check

Explanation

The description relates directly to the changeset. It cites Closes #1441, states that the refactor is done, and lists completion checks such as the single PASSTHROUGH_OPERATIONS definition, the nine remaining case arms, and the removal of handleRequest references. The objectives describe the same work. Some details are agent-generated status notes, but the description is clearly on-topic.

Full details: Linked Issues check

Explanation

[#1441] Checked src/daemon/server-requests.ts at the reviewed head (81f7f7a). The module-private PASSTHROUGH_OPERATIONS: ReadonlySet&lt;OperationName&gt; holds exactly the 37 names listed in the issue. The switch in ConnectionRequests.handle keeps 9 case arms: lease.request, lease.release, lease.release-all, lease.release-run, device.exec, component.install, worker.install-component, relay.request, daemon.update. The default arm guards with (PASSTHROUGH_OPERATIONS as ReadonlySet&lt;string&gt;).has(frame.type) and dispatches frame.type as OperationName with frame.payload and this.#session(connection), as the issue specifies. The default still throws UNKNOWN_REQUEST for other types. The Fallow suppression comment on handle and the driver.passthrough and worker.* (ADR 0005 §23) rationale now sit on the set. None claims the switch is the socket's whole surface. The #handleRequest references in server-options.ts and server.ts were changed to ConnectionRequests.handle per the diff summary. The PR reports no test changes (0 before, 0 after). The existing socket tests are unchanged. Not independently verified: the grep results for case " and handleRequest, and the pnpm check result, which rest on the author's reports and CI.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff (merge base 200afe5 to head 81f7f7a), as summarized, touches only src/daemon/server-requests.ts (code change), src/daemon/server-options.ts (one comment), and src/daemon/server.ts (one comment). No test files, dispatcher handler tables, HTTP routes, or modules outside src/daemon are reported as changed. Each change maps to a requirement in #1441: the set consolidation, the default-branch guard, and comment rewording. The local vitest.mutate.config.ts skip was reported as uncommitted and is not part of the diff. No unrelated change was found.

  • 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: 7c2db5d3-a0c2-40a7-bfe6-9e61e480e847
Commits

Reviewing files that changed from the base of the PR and between cc79ffe and 81f7f7a.

Files selected for processing: 3

  • src/daemon/server-options.ts
  • src/daemon/server-requests.ts
  • src/daemon/server.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 25, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 1a4d9ff
Round fix-check: 81f7f7a

Runs: 6. Cost USD: 2.6322. Agent seconds: 4827.
Tokens input 177, output 35150, cache read 4361525, cache write 602475.
- build implementer: claude-sonnet-5-5 4441 s $1.4963
- review 1 reviewer: claude-sonnet-5-5 192 s $0.1643
- review 1 code behaviour: claude-opus-5-5 141 s $0.6759
- review 1 claims: claude-sonnet-5-5 16 s $0.1091
- fix 1 implementer: claude-sonnet-5-5 25 s $0.0959
- review fix-check reviewer: claude-sonnet-5-5 12 s $0.0907
Finding outcomes: {"fixed":1}. Classes: {"comment false after refactor":1}.
{"findings":[{"id":"R1","role":"code","class":"comment false after refactor","outcome":"fixed","path":"src/daemon/server-requests.ts","round":"1","fix":"81f7f7a3b"}]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 25, 2026 09:57
@V3RON
V3RON merged commit 16b85fc into main Nov 25, 2026
67 checks passed
@V3RON
V3RON deleted the refactor/1441 branch November 25, 2026 10: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.

Shared helper: PASSTHROUGH_OPERATIONS for the daemon socket's one-call request arms

1 participant