You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(daemon): the socket's pass-through operations sit in one set - #1851
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
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: 4
Check name
Status
Explanation
Title check
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
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
[#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
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<OperationName> 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<string>).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.
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.
{"findings":[{"id":"R1","role":"code","class":"comment false after refactor","outcome":"fixed","path":"src/daemon/server-requests.ts","round":"1","fix":"81f7f7a3b"}]}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
defaultarm, before theUNKNOWN_REQUESTthrow, so the nine remaining arms stay as they were.the data directorytests callprocess.umask(), which Stryker's worker threads refuse — skipped them invitest.mutate.config.tslocally for the run only, not committed.Done when
grep -cE 'case "' src/daemon/server-requests.tsprints 9 (46 at 200afe5, minus 37). — ran on 81f7f7a: prints 9PASSTHROUGH_OPERATIONShas one definition, insrc/daemon/server-requests.ts, holding the 37 names above. —git grepon 81f7f7a: one definition (server-requests.ts:23); names checked by the review's socket probegrep -rn 'handleRequest' src/daemon/prints nothing. — ran on 81f7f7a: no matchsrc/daemon/server-requests.tssays the switch is the socket's whole surface. — claims review round 1 and fix-check at 81f7f7apnpm checkpasses. — CI on the head, required by the merge gateReview
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.