Repository navigation
Conversation
Remove outside shutdown admission, completion records and stop polling. Keep direct close reports and unfinished-work registration fences. Localize internal types and move TestMu v2 capabilities into code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Built-package live verification at The host process imported {"phase":"started","pid":73781,"stateDir":"/Users/michal/.t3/worktrees/agent-device/plugin-v2-cleanup/.tmp/plugin-v2/live-state-nM6GoL","sessions":[]}From a separate shell: node /Users/michal/.t3/worktrees/agent-device/plugin-v2-cleanup/bin/agent-device.mjs daemon stop --state-dir /Users/michal/.t3/worktrees/agent-device/plugin-v2-cleanup/.tmp/plugin-v2/live-state-nM6GoL --jsonExit: 1. Output: {
"success": false,
"error": {
"code": "COMMAND_FAILED",
"message": "A host process owns this runtime, so it was not retired.",
"hint": "The runtime is owned by host process 73781. Close it there with the handle returned by startAgentDevice(). If the host has exited, call ensureDaemon() for this state directory to recover its abandoned registration.",
"diagnosticId": "mvgw06wf-8d7ff679",
"details": {
"reason": "daemon-owner-embedded",
"stateDir": "/Users/michal/.t3/worktrees/agent-device/plugin-v2-cleanup/.tmp/plugin-v2/live-state-nM6GoL",
"daemon": { "pid": 73781, "processStartTime": "Tue Oct 20 18:17:53 2026" }
}
}
}The host then queried its client again, called {"phase":"still-serving","sessions":[]}
{"phase":"close","report":{"providerReleases":{"completed":[],"pending":[],"unknown":[]},"requests":{"drained":0,"abandoned":0},"platformOwners":"closed","runners":{"stopped":[],"handedOff":[]},"sessions":{"closed":0,"failed":0},"plugins":{"disposed":["browserstack","aws-device-farm"],"failed":[],"pending":[]}}}Local exact-head receipt The final independent review accepted the unconditional refusal required by the handoff. Its suggestion to restore dead-owner stop success was declined because embedded and unknown registrations must refuse; existing managed startup retains abandoned-owner recovery. The lower-level retirement ownership guard remains for direct callers. |
|
Size Report
Startup median (7 runs, lower is better):
|
|
Thanks for the PR. The code at 86ae7b7 has no blocking problems, and all 19 checks pass. The live check comes from your PR comment, and I did not rerun it. One design question below is still open. I also did not run a mixed-version case, where a 0.21.29 CLI sends daemon_shutdown to an embedded runtime built from this head. From the code, I expect an error and no signal, but I did not execute it. The head test "stop refuses an embedded registration even after its host exits" may not record a start time. If so, it does not cover the case where the shared retirement could prove the host exited. Please confirm that, or add a case that records the start time. Not blocking, and you can take or leave these: the new embedded/unknown branch in daemon-client-stop.ts rebuilds the refusal that Could Before merge, please settle that question and add the changeset for the |
Centralize stop owner refusals and preserve released host diagnostics. Document the stop behavior and removed reasons in a patch changeset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep helpers private after the shared stop route removes their external callers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep missing stateDir as plain INVALID_ARGS with its hint, per the maintainer decision. Name all four accidentally released reasons in the patch changeset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Align ownership comments, the client reason reference, and ADR 0034 with live-host refusal and proven-exit retirement. Keep cleanup comments about detached process-tree authority. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Round 2 settles the decision: YES, Item-to-commit mapping:
Second-order removals (one per line):
Doc/comment fixes (one per line):
Sweep evidence: production unused-exports gate passed twice; Fallow audit passed after export cleanup. Whole-repo Full PR: 2,266 gross changed lines, under 2,500; no follow-up stack needed. Independent read-only reviews found no regressions at the final head. Validation at CI: pending at publication; this comment will be updated when it settles. Full live and mixed-version outputBuilt-package live check at {
"phase": "ready",
"pid": 89094,
"sessions": []
}{
"phase": "registration",
"pid": 89094,
"processStartTime": "Tue Oct 20 20:04:33 2026",
"ownership": "embedded",
"stateDir": "/Users/michal/.t3/worktrees/agent-device/plugin-v2-cleanup/.tmp/plugin-v2/live-round2-state-VIr3WK"
}{
"phase": "head-cli-live",
"exit": 1,
"stdout": "{\n \"success\": false,\n \"error\": {\n \"code\": \"COMMAND_FAILED\",\n \"message\": \"The daemon was not stopped, because its owner ends it.\",\n \"hint\": \"The runtime is owned by host process 89094. Close it there with the handle returned by startAgentDevice(). If the host has exited, use daemon stop or ensureDaemon() for this state directory to recover its abandoned registration.\",\n \"diagnosticId\": \"mvgztadz-05d19b0c\",\n \"details\": {\n \"pid\": 89094,\n \"processStartTime\": \"Tue Oct 20 20:04:33 2026\",\n \"reason\": \"daemon-owner-embedded\",\n \"terminationReason\": \"embedded-owner\",\n \"retirement\": {\n \"status\": \"retained\",\n \"reason\": \"embedded-owner\",\n \"termination\": {\n \"status\": \"retained\",\n \"reason\": \"embedded-owner\"\n },\n \"removedInfo\": false\n }\n }\n }\n}\n",
"stderr": ""
}{
"phase": "probe",
"signals": [],
"sessions": []
}{
"phase": "v0.21.29-cli-live",
"exit": 1,
"stdout": "{\n \"success\": false,\n \"error\": {\n \"code\": \"SESSION_NOT_FOUND\",\n \"message\": \"No active session. Run open first.\",\n \"hint\": \"Run open first or pass an explicit device selector.\",\n \"diagnosticId\": \"mvgztewg-89b9f540\",\n \"logPath\": \"/Users/michal/.t3/worktrees/agent-device/plugin-v2-cleanup/.tmp/plugin-v2/live-round2-state-VIr3WK/sessions/default/requests/b01b55cc0eaa0e82.ndjson\",\n \"diagnosticsRecord\": {\n \"session\": \"default\",\n \"requestId\": \"b01b55cc0eaa0e82\"\n }\n }\n}\n",
"stderr": ""
}{
"phase": "probe",
"signals": [],
"sessions": []
}{
"phase": "head-cli-exited",
"exit": 0,
"stdout": "{\n \"success\": true,\n \"data\": {\n \"stopped\": false,\n \"mode\": \"not-running\",\n \"cleanupConfidence\": \"known\",\n \"claimsReleased\": [],\n \"claimsOrphaned\": [],\n \"claimsSuperseded\": [],\n \"claimsUnattributable\": [],\n \"providerReleases\": {\n \"status\": \"completed\",\n \"released\": [],\n \"pending\": []\n },\n \"warnings\": [],\n \"clean\": false\n }\n}\n",
"stderr": "",
"registrationExists": false
} |
|
Thanks for the update. Commit 7dc1986 fixes most of what the earlier review at 86ae7b7 found, and all 19 checks pass at this head. One problem remains. The I did not rerun the built-package live check or the v0.21.29 mixed-version check from comment 6297850312, and I ran no tests. The |
…rt time Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Round 3 addressed in 86dee15:
Validation at this exact head: |
Summary
Embedded runtimes are closed by the host that starts them.
daemon stoprefuses a live embedded or unknown owner without a request or signal, and retires a registration only after proving its recorded host lifetime exited. In-processclose()returnsShutdownReport; unfinished work retains the registration and lock.Remove external embedded shutdown, completion publication/parsing, and the outside waiter. Remove unused exports and stale guidance. Keep missing
stateDiras plainINVALID_ARGSwith its hint. The patch changeset names all four accidentally released reasons. Localize internal types and declare TestMu v2 capabilities in code. Released v1 migration remains in #3759.36 files; +453/−1,869 (2,322 gross). Follows the cleanup handoff and maintainer decisions. Part of #3747.
Validation
Head
86dee15e8610c7800e82889b2331c307e8379de2; base421dd7e8e7.7dc1986: built-package live check: live host refused, zero signals, still serving; exited host registration retired.7dc1986: v0.21.29 CLI against that head: error, zero signals, host still serving.