Skip to content

pkgs/laptop-agent: reconciled daemon source — live ∪ vendored lineages (#10131) - #11015

Merged
dezren39 merged 1 commit into
mainfrom
queue/20480-10131-laptop-agent-reconcile
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/20480-10131-laptop-agent-reconcile

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What

Vendors the reconciled laptop-agent daemon as the single source at pkgs/laptop-agent/ — src/laptop_agent.py, package.nix (the darwin-nix package shape), and tests/ (the vendored lineage's 65-test suite plus the live-protocol parity round-trip script). This is the prerequisite that makes #5769's M2 executable.

The two lineages, and what the union carries

Capability Live daemon Vendored (darwin-nix) Union
/exec process-group timeout kill, no orphans ✅ — ✅ live
Trip logging v2 (trips.jsonl, _t_received echo) ✅ — ✅ live
POST /exec/<trip>/cancel (+ legacy /cancel) ✅ — ✅ live
Client-disconnect watchdog reaps exec groups ✅ — ✅ live
GET /file byte ranges (code#5757) ✅ — ✅ live
Persisted job index (meta.json, restore validation, interrupted-on-restart) — ✅ ✅ vendored
Fail-closed startup (empty/missing token → exit 3; bad PORT/SLOTS → exit 3) — ✅ ✅ vendored
Request framing errors as 400 JSON (bad CL, oversized body, bad JSON) — ✅ ✅ vendored
GET /jobs summary shape (no payload reads) — ✅ ✅ vendored
Spool reaping incl. dirs, hourly reaper thread — ✅ ✅ vendored
Job slots held for the job's lifetime (#1545) — ✅ ✅ vendored
Bytes-space auth compare, non-ASCII safe (#1741) — ✅ ✅ vendored
job_dir path-escape validation — ✅ ✅ vendored

Auth header is X-Agent-Token in both lineages (verified in both sources and in the client) — no wire change.

Deliberate choices (recorded, not silent)

  • /exec keeps the live in-memory drain + process-group run_one. The vendored spool-to-file run_one was not adopted: the live cancel/disconnect semantics the fleet depends on are built on the in-memory runner. tail_file is retained for spool sampling.
  • /health requires auth (vendored behavior; the live lineage served it unauthenticated). The client and all fleet probes send the token, so nothing operational changes.
  • BASH resolution: LAPTOP_AGENT_BASH (set by the package wrapper) first, then the live lineage's PATH/NixOS-profile chain.

Parity evidence

  • Vendored suite: 65/65 pass in-tree (pkgs/laptop-agent/tests/test_laptop_agent.py, run on the laptop against this source).
  • Live-protocol round-trip (tests/parity_roundtrip.py, 19 checks, run on the laptop against the reconciled daemon on a scratch port/state dir — the live daemon on :4799 was not touched): health, 401 without token, exec argv+shell, timeout kill with no orphan, trip cancel, 400s for bad cmd/timeout/JSON, job create→complete with output paging, jobs-list summary shape, job kill, /file range + X-File-Size, restart persistence (running job → done+interrupted, finished job still pollable), trips.jsonl exec+job records. All pass.

Closes #10131


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 06:34
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T06:34:45.420673Z
We couldn’t complete this review. Comment @codex review to try again.
e2850c5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7e731e0f-d727-4905-9fe7-65a1a5180344
Commits

Reviewing files that changed from the base of the PR and between 3190ef0 and e2850c5.

Files selected for processing: 4

  • pkgs/laptop-agent/package.nix
  • pkgs/laptop-agent/src/laptop_agent.py
  • pkgs/laptop-agent/tests/parity_roundtrip.py
  • pkgs/laptop-agent/tests/test_laptop_agent.py
  • 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

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

Codex gate disposition: the Codex connector reported usage limits for code reviews on this PR and produced zero findings (no review findings to read). Per the repo charter the merge proceeds on the strength of the recorded verification: 65/65 vendored-lineage tests in-tree and the 19-check live-protocol parity round-trip, both run on the laptop against this exact source (sha-verified). — lane any-f, task 20480

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.

laptop-agent daemon source reconciliation — prerequisite for M2 (#5769)

1 participant