Skip to content

feat(cli): scripted takeover hold and release subcommands - #4288

Open
strzhao wants to merge 12 commits into
callstack:mainfrom
strzhao:forge/takeover-scripted
Open

strzhao wants to merge 12 commits into
callstack:mainfrom
strzhao:forge/takeover-scripted

Conversation

@strzhao

@strzhao strzhao commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rescoped per #4340 and the ADR 0040 alignment: takeover hold pins the device of the caller's admitted lease through the existing leases.humanControl RPC — no host-admin HTTP surface, no device naming, no backend derivation. The hold refuses device-naming flags with hold-device-from-lease; identity comes only from the admitted lease. Mutations served by that lease refuse with DEVICE_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/holds with the local daemon token.

Head, the same flags refuse, and the hold rides the lease:

$ agent-device takeover hold --platform android --serial <serial>
Error (INVALID_ARGS): takeover hold pins the device of the admitted lease; drop the device and backend flags.
  reason: hold-device-from-lease
$ agent-device takeover hold --session remote-session --reason "handing to QA" --ttl-ms 60000
Human control active for <device-key from the lease>.

Validation

  • pnpm vitest run takeover command-surface registry-device-claim-policy --project unit-core: 316 passed at head e082e50; test:integration:progress:check and the untyped-reason ratchet pass; tsc clean.
  • Daemon-side hold behaviors (drain-before-active, mutation refusal with 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

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment thread src/__tests__/takeover-command.test.ts Resolved
Comment thread src/cli/commands/takeover.ts Resolved
Comment thread src/cli/commands/takeover.ts Resolved
Comment thread src/cli/commands/takeover-hold-admin.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/cli/commands/takeover.ts Resolved
Comment thread src/cli/commands/takeover-hold-admin.ts Resolved
Comment thread packages/client/src/lease-client.ts Resolved
const target = hold.scope.deviceKey;
return [
`Human control active for ${target}.`,
`Agent interactions are paused. Release with: agent-device takeover release ${hold.id}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Comment thread src/__tests__/takeover-command.test.ts Resolved
@thymikee

thymikee commented Nov 6, 2026

Copy link
Copy Markdown
Member

I reviewed a64b8b5 and found two problems that need a fix before merge. Repo Guards & Compatibility fails in "Check import-direction DAG" because src/__tests__/takeover.test.ts is named for no module in src/. The PR adds that file, so rename it for its module (for example takeover-hold-admin.test.ts) or move it beside src/cli/commands/takeover-hold-admin.ts. Smoke Tests and Coverage were still running when I looked. There are no conflicts.

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 lease=undefined (request-admission.ts#L106-L109), and runDeviceMutation(undefined) runs with no hold check (lease-registry.ts#L482-L483). So a hold stops only device-scoped leases whose backend, provider and device key match exactly. A script that runs takeover hold --platform android --serial X would think it owns the device while a local session keeps installing and tapping. Blocked work also does not wait: it throws DEVICE_IN_USE with reason human_control_active. Please make the docs name exactly the population a hold reaches (device-scoped leases served by that daemon), say that allocation and mutations are refused, and drop the local side-car motivation. Blocking local sessions is the local takeover that ADR 0007 defers.

Does takeover hold also trust connection defaults for the host endpoint? resolveHostHoldAdmin (takeover-hold-admin.ts#L38) reads flags.daemonBaseUrl and flags.daemonAuthToken, and in a workspace with an active remote connection src/cli.ts#L387-L396 merges the connection's URL and tenant credential into those flags. The host-only admin route would then get a tenant credential, which ADR 0007 forbids, and the proxy does not forward that route (plain-text 404, then a raw SyntaxError). The same merge flips takeover release to the lease path. I read this from the code and did not run it. The rule: the host-admin endpoint and token come only from flags typed for this invocation or from the local daemon registry. The explicitFlagKeys set that cli.ts already computes enumerates what was typed. Please give host release its own explicit spelling instead of inferring it from lease flags.

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 devices.list) where the daemon already owns it in pickProxyLeaseDeviceKey and leaseDeviceBindingKey, so the copy drops the provider axis and maps --platform ios to ios-instance instead of ios-simulator; no test sends a CLI-built scope to a real LeaseRegistry or the human-control HTTP handler, so the gaps above cannot turn a test red, and one test that holds, expects DEVICE_IN_USE on the matching lease, then releases would cover it; activation drains admitted mutations but the CLI aborts after 10s, so a typed retry reason or a configurable cap would help; and the deviceKey flag key matches the key leaseScopeFromRequest reads, so a takeover-specific key would avoid a silent lease-scope set if flags are ever forwarded.

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 resolveHoldScope, resolveSelectedDeviceKey, the client-entry export and most of takeover-hold-admin.ts. For local side-car scripts, would a script-held device claim (stale by pid, released by device release) fit better? It already blocks open sessions and sessionless mutations and needs no HTTP listener. That path needs an ADR 0007 amendment first.

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 --lease-backend through the client config at src/cli.ts#L507, so please resolve them: r4496732871 and r4496736415.

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.

@thymikee

thymikee commented Nov 6, 2026

Copy link
Copy Markdown
Member

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 lease=undefined, and runDeviceMutation(undefined) runs no hold check (https://github.com/callstack/agent-device/blob/98c780b/packages/daemon/src/resources/lease-registry.ts#L482-L483). So a host hold only refuses device-scoped leases whose backend, provider and device key match. The help text and the PR body still say the hold blocks device mutations on that device, and they motivate it with local side-car scripts. A script that runs takeover hold --platform android --serial X would believe it owns the device while a local session keeps installing and tapping. Could the docs name the exact population the hold reaches (device-scoped leases served by that daemon, where allocation and mutations fail with DEVICE_IN_USE human_control_active and do not wait), and drop the local side-car motivation? If local holds are a goal, ADR 0007 would need an amendment and a device claim for them.

The host admin endpoint and token come from flags.daemonBaseUrl and flags.daemonAuthToken (https://github.com/callstack/agent-device/blob/98c780b/src/cli/commands/takeover-hold-admin.ts#L38). cli.ts fills those from the active remote connection through mergeConnectionFlags. Release also switches to the lease path through hasLeaseScope when a connection supplies a session or tenant. With an active remote connection, I expect the tenant credential to go to the host-only admin route, which ADR 0007 forbids. The proxy would then answer a plain-text 404, the CLI would show a raw SyntaxError, and host release would go to the wrong place. Is that what happens? The rule should be that the host endpoint and token come only from flags typed for this invocation (explicitFlagKeys) or from the local daemon registry, and that host release has its own explicit spelling and is not inferred from lease flags.

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 hasLeaseScope (#4288 (comment)) still stand. Eleven other open threads (P2 and lower) also still apply, and the code they point at did not change. Two threads do not apply, because src/cli.ts:507 reads the lease backend through the client config: please resolve #4288 (comment) and #4288 (comment).

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: takeover hold, a matching device-scoped lease mutation that returns DEVICE_IN_USE human_control_active, then release. Also run it under an active remote connection to show the host endpoint comes from the local registry.

@thymikee

thymikee commented Nov 7, 2026

Copy link
Copy Markdown
Member

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.

@thymikee

thymikee commented Nov 8, 2026

Copy link
Copy Markdown
Member

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.

  • It doesn't fence ordinary local sessions. The lease gate skips holds when no lease exists (lease-registry.ts:482), so the local side-car problem in the description stays unsolved. That case is outside ADR 0007's lease-owned human-control lifecycle.
  • It mixes host administration with remote connection defaults. The host scope leaves out provider identity. Endpoint selection accepts flags already filled in from a remote connection. Release authority is inferred from session and tenant flags (takeover.ts:60, :91, takeover-hold-admin.ts:38).

Proposed scope:

  • agent-device takeover hold --session <s> --reason "…" --ttl-ms 60000 --json calls the existing leases.humanControl.put. It takes backend, provider and device identity only from the admitted lease.
  • agent-device takeover release <hold-id> --session <s> never switches authority implicitly.
  • No admission scan, polling loop, persistent store or device discovery: one existing hold RPC.
  • Out of scope: local-device exclusion and new host-admin CLI plumbing. Host administrators keep the explicit admin API.
  • Done when it proves drain-before-active, mutation refusal, continued reads, expiry, release and ownership rejection through a proxy or cloud route.

Could you rescope the PR along these lines?

@thymikee

Copy link
Copy Markdown
Member

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.

strzhao and others added 6 commits November 23, 2026 10:11
…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>
@strzhao
strzhao force-pushed the forge/takeover-scripted branch from 98c780b to e082e50 Compare November 23, 2026 02:21
@strzhao

strzhao commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Narrowed per the ADR 0040 alignment and #4340's smallest version (e082e50, net −592 lines):

  • takeover hold now rides the existing leases.humanControl RPC: the daemon derives authority from admittedLease, so the CLI takes backend, provider and device identity from the lease alone. Device-naming and backend flags refuse with the typed hold-device-from-lease reason and a hint to admit the lease first; the host-admin HTTP path and its tests are deleted, and host administrators keep the explicit admin API.
  • takeover release <hold-id> removes through the same lease client; the dual lease/host branching is gone.
  • Help and the command description name the exact population: device mutations served by that lease refuse with DEVICE_IN_USE and do not wait; reads and heartbeats continue; TTL or release ends it.
  • Expiry stays on the daemon side, so the race with first open, drain, release and cross-owner refusal lands where ADR 0040 step 4 — Settle an expired session lifetime once #4968's single settle decision is heading; this surface adds no client-side expiry or polling.

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

@thymikee

Copy link
Copy Markdown
Member

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.

holdDeviceNamed checks platform, target, device, udid, serial, deviceKey and leaseBackend on the merged flags, not on what the user typed. Under a saved remote connection, resolveRemoteConnectionDefaults fills leaseBackend and platform (remote-connection-state.ts#L549-L553). Without a connection, AGENT_DEVICE_PLATFORM or project config fills platform (cli.ts#L396-L404). The hold then throws INVALID_ARGS before leases.humanControl.put runs. So takeover hold --session s, the route the help describes, refuses and tells the user to drop flags they never typed. The unit tests miss this because they pass a hand-built flag object. Not verified here: this is traced from code and was not run against a saved connection state. The rule: the hold reads no device, backend or provider identity from the CLI, because the admitted lease is the only source and the daemon already enforces that (human-control.ts#L13-L31). The smallest fix is to delete holdDeviceNamed, its takeover reason row and docs section, the deviceKey flag and CliFlags key, and the device flags added to takeover.supportedFlags. If a typed refusal must stay, decide it from the flags the user actually provided, never from merged flags. Please add one test through the CLI entry with a saved connection that carries leaseBackend and platform, and assert that put is sent.

Required before merge: a live run from a remote connection (proxy or cloud) with the evidence #4340 asks for. The output should show connect plus open --session s, then takeover hold --session s --json returning the hold with the lease's deviceKey. Then it should show a mutation on s failing with DEVICE_IN_USE (human_control_active), a snapshot succeeding, and takeover release <id> --session s followed by a mutation that passes. It should also show a second session's takeover release <id> rejected for ownership. The earlier review asked for this run, and the PR still has only unit tests and older daemon tests. A live run would have caught the problem above.

Not blocking, take or leave: the normalizeHumanControlHold re-export in packages/client/src/index.ts#L80 has no consumer now that takeover-hold-admin.ts is gone, so reverting both client hunks fixes the Fallow failure; and the help in command-overrides.ts#L172 and cli-help.ts:520 could say that device mutations and allocation from any device-scoped lease this daemon serves for the admitted lease's device refuse with DEVICE_IN_USE (human_control_active), as #4340 asks.

For a follow-up issue, not for this PR: the --device-key description in flag-definitions-connection.ts#L169 still promises that selectors derive the key, and explain takeover prints it; this goes away with the fix above.

Open threads: the high-priority threads on the hint that omits --session (#4288 (comment) and #4288 (comment)), the unused re-export (#4288 (comment)), ignored bare-takeover flags (#4288 (comment)) and missing --reason/--ttl-ms in takeover --help (#4288 (comment)) still apply and are not blocking, and one lower-priority thread still applies (#4288 (comment)). These do not apply at head and can be resolved: #4288 (comment) (test file deleted), #4288 (comment) (empty --device-key now refuses), #4288 (comment) (hasLeaseScope removed), #4288 (comment) (admin HTTP reader deleted), #4288 (comment) (status and release use leaseBackend; hold refuses it), #4288 (comment) (daemon resolves scope from the admitted lease), #4288 (comment) (readHostHoldResponse deleted), #4288 (comment) (hold no longer consumes leaseBackend). These are fixed at head: #4288 (comment) and #4288 (comment).

CI shows two failures caused by this PR. command-doc-generated-blocks.test fails because website/docs/docs/commands.md line 437 still has the old synopsis, and pnpm generate:command-docs fixes it. Repo Guards fails on the unused re-export above. Body rules was cancelled. The Coverage job output was cut before its failure summary, so its cause is unclear.

The code needs the fix to takeover.ts:78 before it can merge, and no conflicts are known.

strzhao and others added 4 commits November 23, 2026 12:10
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>
@strzhao

strzhao commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

The merged-flags misfire is fixed the small way (8643981): holdDeviceNamed, its reason row and docs section, the deviceKey flag definition and the CliFlags key are deleted — the hold reads no device, backend or provider identity from the CLI at all, and the daemon's admitted-lease enforcement stays the only gate. The help now also says allocation from any device-scoped lease this daemon serves for that device refuses with DEVICE_IN_USE (human_control_active).

The required CLI-entry test is in: cli-takeover-hold.test.ts writes a saved remote connection carrying leaseBackend + platform, runs takeover hold --session s through the CLI entry, and asserts the human_control put reaches the daemon with the payload — the exact route your trace showed refusing.

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 pnpm check:fallow is clean; the stale generated docs and the stale help assertion that failed Coverage are also fixed (dae0f8f, 11b0edd). All 13 lanes were green at 11b0edd before this push.

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>
@strzhao

strzhao commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

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, connect proxy).

The requested sequence, all live:

  • connect + open --session s admits the lease; takeover hold --session s --json returns the hold with the lease's deviceKey and no flag named a device
  • a mutation on s fails with DEVICE_IN_USE (human_control_active, the human-hold wording); snapshot succeeds in the same window
  • takeover release <id> --session s releases, and the mutation passes
  • a second session with its own lease on another device releasing s's hold is refused typed: UNAUTHORIZED: Human-control hold does not belong to the admitted lease; the owner's release still works
  • expiry: a 5s hold refuses the mutation inside the window and the same mutation passes after it, without a release
  • a second lease on the same device cannot exist: s2's open on the Android unit answers DEVICE_IN_USE (Device is already leased), which keeps the hold's population at the leases served for that one admitted device

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

@thymikee

Copy link
Copy Markdown
Member

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: takeover.supportedFlags still lists platform, target, device, udid and serial. They were added for the removed host and selector path. They are in no flagsByAction list, so findFlagsTheActionCannotRead does not refuse them. A typed takeover hold --session s --serial B is now accepted and ignored, where base refused it. Deleting those five names fixes it. Connection and env defaults do not depend on supportedFlags, so the saved-connection test should keep passing.

Of the earlier inline threads, two still apply and are non-blocking: the release hint printed by renderTakeoverHold (#4288 (comment) and #4288 (comment), both about the missing session and daemon flags), and bare takeover --ttl-ms being ignored (#4288 (comment)). These no longer apply because the code was deleted or changed, so please resolve them: #4288 (comment), #4288 (comment), #4288 (comment), #4288 (comment), #4288 (comment), #4288 (comment), #4288 (comment), #4288 (comment), #4288 (comment). These are fixed at head, so please resolve them too: #4288 (comment), #4288 (comment), #4288 (comment), #4288 (comment).

Not verified here: cli-takeover-hold.test.ts was traced but not run locally, and CI is green at head. The live run is a committed markdown file over a loopback proxy, with the device key redacted and the snapshot success described rather than shown. It also does not show the creation of hold takeover-9617435c, only the UNAUTHORIZED refusal and its release by session s.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member

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 renderTakeoverHold (#4288 (comment) and #4288 (comment)) still apply and are not touched by this change. They still hold, and they are the only thing left: the printed hint takeover release <id> omits --session (and any daemon flags), so a caller who copies it cannot reach the hold. Printing the release command with the same --session the hold used closes both threads. Nothing else must happen before merge.

This branch has not been deployed

No deployments
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.

2 participants