Repository navigation
Conversation
There was a problem hiding this comment.
1 issue found across 11 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/cli/commands/takeover.ts">
<violation number="1" location="src/cli/commands/takeover.ts:245">
P2: The copied release command drops the daemon selection used to create the host hold. With `--daemon-base-url` or a non-default `--state-dir`, it targets the default local daemon and cannot release this hold; retain the connection context or avoid presenting a bare copy-paste command.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| const target = hold.scope.deviceKey; | ||
| return [ | ||
| `Human control active for ${target}.`, | ||
| `Agent interactions are paused. Release with: agent-device takeover release ${hold.id}`, |
There was a problem hiding this comment.
P2: The copied release command drops the daemon selection used to create the host hold. With --daemon-base-url or a non-default --state-dir, it targets the default local daemon and cannot release this hold; retain the connection context or avoid presenting a bare copy-paste command.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/cli/commands/takeover.ts, line 245:
<comment>The copied release command drops the daemon selection used to create the host hold. With `--daemon-base-url` or a non-default `--state-dir`, it targets the default local daemon and cannot release this hold; retain the connection context or avoid presenting a bare copy-paste command.</comment>
<file context>
@@ -113,6 +238,15 @@ export function renderTakeoverStarted(hold: HumanControlHold): string {
+ const target = hold.scope.deviceKey;
+ return [
+ `Human control active for ${target}.`,
+ `Agent interactions are paused. Release with: agent-device takeover release ${hold.id}`,
+ `Hold: ${hold.id}`,
+ ].join('\n');
</file context>
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/cli/commands/takeover.ts">
<violation number="1" location="src/cli/commands/takeover.ts:245">
P2: The printed release hint drops the daemon connection the hold was created on. When `--daemon-base-url`, `--daemon-auth-token`, or `--state-dir` was used, the hint should carry them, or the output should say the same flags are required for release.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| const target = hold.scope.deviceKey; | ||
| return [ | ||
| `Human control active for ${target}.`, | ||
| `Agent interactions are paused. Release with: agent-device takeover release ${hold.id}`, |
There was a problem hiding this comment.
P2: The printed release hint drops the daemon connection the hold was created on. When --daemon-base-url, --daemon-auth-token, or --state-dir was used, the hint should carry them, or the output should say the same flags are required for release.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/cli/commands/takeover.ts, line 245:
<comment>The printed release hint drops the daemon connection the hold was created on. When `--daemon-base-url`, `--daemon-auth-token`, or `--state-dir` was used, the hint should carry them, or the output should say the same flags are required for release.</comment>
<file context>
@@ -113,6 +238,15 @@ export function renderTakeoverStarted(hold: HumanControlHold): string {
+ const target = hold.scope.deviceKey;
+ return [
+ `Human control active for ${target}.`,
+ `Agent interactions are paused. Release with: agent-device takeover release ${hold.id}`,
+ `Hold: ${hold.id}`,
+ ].join('\n');
</file context>
|
I reviewed a64b8b5 and found two problems that need a fix before merge. Repo Guards & Compatibility fails in "Check import-direction DAG" because The help text and PR body say a host hold blocks device mutations on that device (cli-help.ts#L512). A local session with no lease is admitted with Does Not blocking, and each can be taken or left: the CLI re-spells the daemon's contention identity (backend from the platform, device key from Could this be simpler by first deciding who the hold is for? For remote lease hosts, the host PUT could accept device selectors (or an exact scope) and let the daemon fill backend, provider and device key from its own resolver. The CLI would then only forward selectors to an explicitly typed or locally registered endpoint, which removes The open threads still stand: provider key, release hint flags, typed reasons test, remove request assertions, empty device key, host release path, 404 parse order, client export surface, hold hint flags, bare takeover args and help flag list. Three lower-priority threads also still apply. Two do not apply because status and release read After the rename, please decide the population, then scope the docs and move scope resolution into the daemon (or use device claims for local holds), and source the host endpoint only from explicit flags or the local registry. I ran nothing against a live daemon, so the two findings come from reading the code at that commit. |
|
Thanks for the update. At 98c780b the move of the test file fixed the import-direction check, and all 11 checks pass. The two problems from the earlier review (#4288 (comment)) are still there, because this change only touched a test import path. I read both from the code and did not run a live daemon. A local session without a lease is admitted with The host admin endpoint and token come from Of the open inline threads from the other reviewer, the P1 on the host hold omitting the lease provider (#4288 (comment)) and the P2 on release routing from No conflicts are known. Before merge, fix the docs to match the true hold population and take the host endpoint and token only from explicit flags or the local registry. Then please add a live run with a real daemon: |
|
Tracked in #4318, group C (new public surface). We're reviewing the six feature PRs together for coherence and for performance impact on paths that don't use them, and we'll post a direction there. Please hold changes here until then. |
|
Thanks @strzhao. We reviewed this with the rest of group C in #4318. Scripted handoff fits remote devices well, but the smallest useful version works on the caller's admitted lease, not on inferred host administration.
Proposed scope:
Could you rescope the PR along these lines? |
|
ADR 0040 alignment (ADR) Decision: scripted takeover: Follow #4340 and narrow this PR to the caller's admitted remote lease. Use the existing human-control lease RPC for hold and release. Derive backend, provider and device only from the admitted lease, and keep host administration on its existing explicit surface. Coordinate #4968's pending hold and mutation pass so the race with first open, drain, release, expiry and cross-owner refusal shares one decision. Keep read-only commands and heartbeats working during a hold. |
…human-control admin API A bypass script can now pin one device without a lease: takeover hold writes a host hold through the daemon's host-only /admin/human-control/holds API with a single-device scope, and takeover release without a session or lease removes a host hold by id. The hold names its device with --device-key or with --platform plus device selectors, resolved through the normal device listing and spelled with leaseDeviceKey the way the daemon spells one; --lease-backend or --platform names the backend; --reason and --ttl-ms (default 60000) carry the reason the blocked agent sees and the safety window. The foreground lease takeover, status, and lease-owned release behavior is unchanged. New CLI flags: --device-key, --reason, --ttl-ms, classified intentionally outside provider-backed integration coverage in the progress model. Versioned help and the takeover schema (usage, flagsByAction, supportedFlags) stay in sync. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
98c780b to
e082e50
Compare
|
Narrowed per the ADR 0040 alignment and #4340's smallest version (e082e50, net −592 lines):
Validation: 316 unit tests across the touched projects, integration-progress check, untyped-reason ratchet, tsc. The completion conditions that need a proxy or cloud route (drain-before-active, refusal, reads-continue, expiry, release, ownership rejection) ride the daemon-side lease coverage; say the word if you want a live proxy-route capture appended here. Co-Authored-By: Claude Code noreply@anthropic.com |
|
Thanks for the rework in e082e50. The host path, the admin HTTP reader and the client-side selector resolution are gone, and release now goes through the lease client. That fixes most of the earlier findings (#4288 (comment)). The hold still cannot work on its main route, so this needs another change before merge.
Required before merge: a live run from a remote connection (proxy or cloud) with the evidence #4340 asks for. The output should show Not blocking, take or leave: the For a follow-up issue, not for this PR: the Open threads: the high-priority threads on the hint that omits CI shows two failures caused by this PR. The code needs the fix to |
Co-Authored-By: Claude Code <noreply@anthropic.com>
…h owned Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
|
The merged-flags misfire is fixed the small way (8643981): The required CLI-entry test is in: On the take-or-leave re-export: the fallow failure at e082e50 is fixed the other way (fa0e302) — the index re-export is removed and the function de-exported to its module, and The live proxy/cloud run is the remaining required item; it is next. Co-Authored-By: Claude Code noreply@anthropic.com |
Co-Authored-By: Claude Code <noreply@anthropic.com>
|
The live proxy-route run is recorded: docs/evidence/takeover-hold-lease-2026-11-23.md at 6be672b, on the branch build with the proxy protocol over loopback (device host and agent on one machine, separate state directories, the proxy's bearer token, The requested sequence, all live:
Stated limits in the doc: the route is loopback (no tunnel or cloud provider in the path), and drain-before-active is not staged live — it stays with the dispatch chain's own coverage. Co-Authored-By: Claude Code noreply@anthropic.com |
|
Thanks for the update. Both findings from the earlier review (e082e50, #4288 (comment)) are now closed at 6be672b: the device-flag refusal is deleted, the saved-connection CLI test is added, and the live proxy run is attached. The code looks good to merge. CI is green, with 16 checks and none failing. Nothing else is needed before merge. Not blocking, and you can take or leave it: Of the earlier inline threads, two still apply and are non-blocking: the release hint printed by Not verified here: |
Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Thanks for the update. The earlier note on 6be672b (#4288 (comment)) is now fixed at 8b04ab2, and the change adds no new problems. All 16 checks are green at this commit, including Lint/Typecheck, Repo Guards and Integration Tests, which cover the takeover schema this change touches. Not verified here: cli-takeover-hold.test.ts and the parser were not run locally, so the saved-connection fix rests on reading the flag handling in args.ts plus the green checks. Not verified here: the new live-run transcript in the evidence doc could not be reproduced; it makes no code or help claim, so it does not affect the code assessment. There are no conflicts. The two open inline threads on the release hint printed by |
Summary
Rescoped per #4340 and the ADR 0040 alignment:
takeover holdpins the device of the caller's admitted lease through the existingleases.humanControlRPC — no host-admin HTTP surface, no device naming, no backend derivation. The hold refuses device-naming flags withhold-device-from-lease; identity comes only from the admitted lease. Mutations served by that lease refuse withDEVICE_IN_USE(human_control_active) and do not wait; reads and heartbeats keep working; the TTL or an explicit release ends the window. Host administrators keep the existing explicit admin API.Before / after
Base,
takeover hold --platform android --serial <serial>derives a device from selectors and writes a host hold through/admin/human-control/holdswith the local daemon token.Head, the same flags refuse, and the hold rides the lease:
Validation
pnpm vitest run takeover command-surface registry-device-claim-policy --project unit-core: 316 passed at head e082e50;test:integration:progress:checkand the untyped-reason ratchet pass; tsc clean.human_control_active, continued reads, expiry, ownership rejection) live in the pre-existing lease-registry and request-handler-chain coverage; the expiry race stays with ADR 0040 step 4 — Settle an expired session lifetime once #4968's single settle decision, and this CLI adds no client-side expiry machinery.🤖 Generated with Claude Code