Skip to content

feat(agent-device): agent-device runs as an optional module on workers - #605

Merged
V3RON merged 9 commits into
task/595from
task/597
Oct 15, 2026
Merged

V3RON merged 9 commits into
task/595from
task/597

Conversation

@V3RON

@V3RON V3RON commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #597

Status

Implement: done (15/15 green) Review: round 1 passed, 4 text fixes applied unreviewed Hardware: deferred to the end of the run Gate: waiting for the stack
Next: hardware check at the end of the run, then the stack gate

Done when

  • Every Tests line passes, and every other test in the suites F11 names passes with only its setup changed and F12's assertions renamed.
  • F7's two supervisor tests are deleted. No other agent-device test is deleted.
  • docs/CONFIGURATION.md documents capabilities.agent-device.*. Its leftover-daemon line says it applies with capabilities.agent-device.enabled true.
  • F14's config writes and deletes use capabilities["agent-device"]; scripts/slow-e2e.sh e2e/slow-agent-device.test.ts and scripts/slow-e2e.sh e2e/slow-agent-device-gateway.test.ts pass on a Mac with an iOS runtime.

Assumptions

  • Assumption: the registry joins the existing daemon/http/agent-device import cycle — two entries added to .dependency-cruiser-known-cycles.json and its ratchet raised from 6 to 8, because the front keeps importing src/http (F19) and the cycle check works at folder scope.
  • Assumption: a stop-order test in main.test.ts — with hooks running concurrently (ADR 0030), it asserts both stop steps ran before the drivers' disposal, not their order between modules.
  • Assumption: module checks run on a gateway too, so a leaseTtlCapMs above lease.maxTtlMs still stops a gateway.

Review

Spec review: 1 blocking, 0 fixed, 0 notes. Code review: 2 blocking, 1 fixed, 0 notes. Claims review: 4 blocking, 4 fixed, 5 notes.
Rounds: 1. Tokens: 12.5M.

Fixed unreviewed: code: src/daemon/optional-modules.test.ts:793 test title; claims: src/agent-device/AGENTS.md:4, docs/internal/agent-rules/architecture.md:78, docs/internal/flows/startup.md:25; after the rebase fix check, docs/internal/flows/startup.md:25 build order.

Rejected:

  • spec: the known-cycles ratchet rises from 6 to 8 against architecture rule 14 — the maintainer chose to keep it for now (option A); the cycles go when agent-device stops importing src/http
  • code: same finding as the spec one — same reason

Written by an agent.

@V3RON

V3RON commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

The question: the spec keeps agent-device's front importing src/http. With the daemon importing the module registry, that adds two cycles to .dependency-cruiser-known-cycles.json, raising the limit from 6 to 8, and architecture rule 14 says that list only shrinks.

  • A: keep the 8-entry limit for now. Users see nothing. This is taken: the maintainer chose to keep going.
  • B: break the cycle now by moving what agent-device takes from src/http away from src/daemon. Users see nothing either; it is a larger refactor than the spec asks for.

Reverting means a follow-up that breaks the cycle and lowers the limit back to 6.

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • claims: src/agent-device/AGENTS.md:5 the "Uses" line omits src/modules and the core runtime validators that definition.ts and worker.ts import
  • claims: src/daemon/AGENTS.md:85 onSocketClaimed lists agent-device as its own step; it now starts inside the module's afterSocketClaimed hook
  • claims: src/agent-device/host/agent-device-supervisor.test.ts:344 the describe "off and starting" and the test "enabled, ..." have no off or enabled case left
  • claims: docs/HTTP-API.md:1522 "This build has no optional module of its own" reads as no module registered, but the registry now lists agent-device

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 15, 2026 13:19
@V3RON
V3RON added this pull request to stack #600 October 15, 2026 13:19
@V3RON

V3RON commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • claims: docs/internal/agent-rules/architecture.md:78 the agent-device lease TTL floor is said to be set in agent-device's config check, but it sits in validator (integerInRange) in src/agent-device/definition.ts:17-27; check only compares the cap to lease.maxTtlMs

Written by an agent.

@V3RON
V3RON merged commit b5fd42b into main Oct 15, 2026
22 checks passed
@V3RON
V3RON deleted the task/597 branch October 15, 2026 17:21
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.

agent-device runs as an optional module on workers

1 participant