Repository navigation
Conversation
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 32 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Apex Sentinel · ✅ ApproveSince the last review: 2 new · 0 still open · 2 no longer raised 2 finding(s): 2 minor. 🟡 Minor (2)
2 findings below 💬 Talking to SentinelIn a finding's thread, reply with:
On this conversation, comment Earlier reviewsReview of
|
| Where | Finding |
|---|---|
packages/daemon/src/sessions/session-lifecycle/internal/session-open-execution.ts:274 |
🆕 Reopen forges boot ownership from a stale booted:false snapshot and close stops it |
packages/daemon/src/sessions/session-lifecycle/internal/session-close-lifecycle-teardown.ts:97 |
🆕 Implicit stop is skipped for a local session whose claim file is gone or expired |
Reviewed with this repository's own Sentinel configuration (ea414582b7fa).
Review of 0e19c8df · 16.11.2026 11:30 UTC
Apex Sentinel · ✅ Approve
Since the last review: 1 new · 0 still open · 1 no longer raised
1 finding(s): 1 minor.
🟡 Minor (1)
| Where | Finding |
|---|---|
packages/daemon/src/sessions/session-lifecycle/internal/session-open-execution.ts:270 |
🆕 Android reopen never refreshes the stored booted bit, so close can stop an emulator it did not boot |
1 finding below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (38e815742740).
Review of 93b40d7c · 15.11.2026 11:23 UTC
Apex Sentinel · 🟠 Request changes
Since the last review: 1 new · 0 still open · 0 no longer raised
1 finding(s): 1 major.
Required fixes
- Session reopen forges boot ownership from a stale
booted: falsesnapshot
🟠 Major (1)
| Where | Finding |
|---|---|
packages/daemon/src/sessions/session-lifecycle/internal/session-open-execution.ts:270 |
🆕 Session reopen forges boot ownership from a stale booted: false snapshot |
1 finding below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (7848a1a9283f).
Review of 8c241431 · 14.11.2026 17:38 UTC
Apex Sentinel · ✅ Approve
Since the last review: 0 new · 0 still open · 1 no longer raised (1 marked fixed)
No open findings.
Reviewed with this repository's own Sentinel configuration (d78be6c88715).
Review of ebce87fa · 14.11.2026 10:01 UTC
Apex Sentinel · ✅ Approve
Since the last review: 0 new · 0 still open · 0 no longer raised
No open findings.
Reviewed with this repository's own Sentinel configuration (d38e35e61193).
Review of fcd2ec89 · 14.11.2026 08:24 UTC
Apex Sentinel · ✅ Approve
Since the last review: 1 new · 0 still open · 2 no longer raised (1 deferred)
1 finding(s): 1 minor.
🟡 Minor (1)
| Where | Finding |
|---|---|
packages/daemon/src/sessions/session-lifecycle/internal/session-open-execution.ts:270 |
🆕 Reopen on a stopped simulator is recorded as a boot and close then shuts down a pre-running device |
1 finding below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (d38e35e61193).
Review of 7dd1ac93 · 14.11.2026 02:28 UTC
Apex Sentinel · ✅ Approve
2 finding(s): 2 minor.
🟡 Minor (2)
| Where | Finding |
|---|---|
packages/daemon/src/sessions/session-lifecycle/internal/session-open-state.ts:76 |
markOpenBootedDevice is called after store.publish rather than setting bootedByOpen on the draft, so the sessio… |
packages/contracts/src/client-app.ts:158 |
warnings?: string[] forces SDK callers to match daemon message text |
Reviewed with this repository's own Sentinel configuration (ddbfc855661f).
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on 7dd1ac9. The verdict and the full list are in the summary comment.
|
CI is green at e5f7ab7 (16 checks, none failing), but the PR is a draft, so the device lanes were skipped and do not cover the Android or iOS lifecycle path. No conflicts. The code has two problems to fix before merge. The new sentence at website/docs/docs/sessions.md:130 says provider-owned devices are not stopped through --shutdown. On a provider session, The Android cold-open route has no live run. The route is bootStoppedLocalAndroidDevice, then markSelectionBootOccurred on the AVD selection, then the serial swap, then plain close with bootedByOpen. The PR body reports that Android cold open failed with DEVICE_NOT_FOUND for emulator-5554 and Pixel_7_CI, and the cause is not diagnosed. Whether the serial device reaches close with bootedByOpen and the emulator really stops is unproven. The iOS run used T3 client 0.21.31, so the head client and CLI warning delivery are not shown either, and the report paths in the PR body are not readable here. Please run the head-built CLI (pnpm build, then the node bin from this checkout with a fresh --state-dir): (1) with the AVD shut down and Not blocking, take or leave: the policy fact is carried per request in req.internal.shutdownCapabilityDenied and hand-copied into the replay cleanup request, while the close handler could read it from its daemon dependencies; the new client warnings pass-through (index.ts:270, index.ts:380, and serializeCloseResult) has no test, since deleting either line keeps every test green, so one client test with a fake transport would cover it; the doc comment at device-selection-resolver.ts:101 still says the boot event holds "once it succeeds", but it is now predicted before dispatch and session selections can claim it; and the cli-help.ts:132 rewrite drops "runners/daemons self-idle after 5 minutes; stale leases self-reclaim", which are unrelated to this change, so please keep them and shorten the new close sentence instead. Could the request-stamped policy flag become a daemon dependency instead? handleSessionCloseCommands would receive deviceShutdownDenied, derived once from the loaded DaemonPolicy where daemon-runtime.ts:218 already derives assertShutdownAllowed, and pass it to runSessionCloseTeardown, the way platformResourceCleanup is threaded. That would delete withShutdownPolicyDeniedFlag, the new isDaemonPolicyCapabilityDenied export path, DaemonRequestInternal.shutdownCapabilityDenied, the router stamp and the replay-cleanup copy, about 25 production lines, with no propagation invariant to keep. bootedByOpen and updateOpenDevice can stay as they are, and setting bootedByOpen on the publish draft would be a small extra simplification. No ADR change looks needed. On the other threads: the threads on boot ownership for reopens and on replay close scope are fixed at this head and can be resolved. These do not apply and can be resolved: skills/agent-device/SKILL.md:16 already limits --shutdown to a local simulator or emulator, and provider shutdown goes through session-close.ts:144-163; skills/android-emulator/SKILL.md:24 states the policy-denied case and scoping to a local emulator is correct; the publish-then-update thread has no reader between the two synchronous calls, so the draft change is only a simplification. The typed-reason thread on warnings still holds but is not blocking, because warnings: string[] is the existing contract convention. |
|
Addressed the source and documentation feedback in fcd2ec8.
I retained the existing display-warning convention; no consumer branches on warning prose. The nonblocking structured-warning suggestion remains deferred rather than being presented as fixed. Live evidence remains limited: the e5 T3-bound iOS daemon cases passed, but its old bound client omitted the warning; Android cold selection failed twice and that route stopped. The new fake-response tests prove current client/serializer projection, not fresh end-to-end device delivery. I have not used an unbound head CLI to bypass the required T3 route. This PR remains draft. |
There was a problem hiding this comment.
All reported issues were addressed across 43 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on fcd2ec8. The verdict and the full list are in the summary comment.
|
Thanks for the update. At fcd2ec8 the per-request policy marker is gone and reopen selections are now classified, so those two earlier findings are fixed. Two problems remain from the earlier review (#4539 (comment)), and one check fails. The Android cold-open route still has no live run, and the PR says there was no fresh device execution at this head. The route is Close help says plain close stops a device "your session booted", but only The Coverage gate fails because of this delta. Open review threads that still apply: #4539 (comment) (close help owner wording, same rule as above) and #4539 (comment) (commands.md provider shutdown). The second one needs a fix: commands.md:107 says provider-owned devices are never stopped this way, but I did not run tests; I judged this from the diff. The new router case in The branch now conflicts with its base 0.22, so please rebase. Before merge, fix the Coverage gate, attach the Android cold-open and close run, and align the close wording and the commands.md sentence. |
fcd2ec8 to
ebce87f
Compare
|
The code from the earlier review (fcd2ec8) is mostly fixed at ebce87f, but two items remain. The Coverage failure is repaired and all 18 checks pass. There are no conflicts. The close owner wording is fixed at The workflow help still over-states who owns the boot. cli-help-workflows.ts:32 and line 288 say plain close stops a simulator or emulator "your session booted". Only The live Android evidence is still missing. The route is session-open.ts:422: cold boot by AVD name, the serial swap, Not blocking, take or leave: Of the open inline threads, the help owner wording thread still applies, because I did not run tests. This review comes from the diff and the code at ebce87f, and the CI result comes from the check summary, not the per-job logs. I did not trace which Limrun lease kinds reach Before merge, please fix the two help lines and attach the Android cold-open to close runs on this head. |
|
Exact local affected admission passed at Command (one invocation):
Independent actual-owner source recheck: NO FINDINGS. Hosted at this head: 16 successful / 1 skipped / 1 neutral. These lanes are separate. Current-client warning rendering and supported cold Android lifecycle proof remain open; stopped device paths were not retried. No merge clearance. |
ebce87f to
8c24143
Compare
|
Published rebased A5 head8c241431f249ce4040fc0f32e5261bc771d9c4a0 on0.22root0081. Independent rebase preservation/prose recheck found no findings: all14patches equal, binary layer byte-identical, disjoint base/layer changes and automatic merge tree equals candidate. Prior actual-owner semantic review applies to unchanged A5 bytes; inaccurate narrative/device-status statements from the new report are excluded rather than treated as live proof. New exact affected admission ran ONCE: raw0,42 passed/25 skipped, all67 FAIL-OPEN checks retained, exactCommit=true,checkoutChanged=false. Direct pnpm11.17.0 frozen install/build0. Defaultorigin/mainD78/mergebase d38; actual0.22root0081 separately. Receipt UTC2026-11-14 17:16:43.404–17:24:34.924. Matching clean fingerprint b3d88311b7cc7f25311dd86d230253375dd990b452d6c609da915f813ccdfb71. ReceiptSHA1dc54abc9653d62201579ab383e4e756a46eea02454a13453db6051f07a4347b. Parent verified all87manifest hashes in evidence directory and archive and all52original/copy evidence files byte-identically, refs/results/pinnedsetup/finalindex. ArchiveSHA d971b2758fe86a9b52f47934ce59b8bbb6dd79323c8f655ced710c9fc5f5c5de, VERIFIED-UNSEALED. Initial read-only shell/controller errors were separate from actual gate execution; no rerun. No printed lock wait; actual wait unmeasured. New-head hosted checks remain owed. Current-client warning delivery and supported cold Android ownership live proof remain BLOCKED. Pixel7 twice DEVICE_NOT_FOUND and Pixel9 KO shutdown routes remain STOPPED; Pixel9 last known ON/unclaimed, no cleanup claim. No device actions or alternate route occurred. No merge/release clearance. |
|
Thanks for the update. The The close help still names the wrong owner. cli-help-workflows.ts:32 and The Android cold-open route is still covered only by unit fakes at session-open-execution.ts:443. That route boots by AVD name, swaps the name for an ADB serial, calls
If the cold open fails with I did not run tests or any device. CI state comes from the check summary, not the per-job logs. The patch is identical to the one in the earlier review, so I did not re-trace the close and open code beyond the owner reads and writes. On the inline threads: the one on |
8c24143 to
93b40d7
Compare
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 93b40d7. The verdict and the full list are in the summary comment.
|
Thanks for the update. At 93b40d7 the owner wording in help now says "this session's open booted" at all three sites, so that part of the earlier review (#4539 (comment)) is fixed. One item remains: there is still no live Android run. The Android cold-open route is covered only by unit fakes. Open boots by AVD name, swaps the name for an ADB serial, then Not blocking, take or leave: the claim-currency condition gates only the permitted branch (https://github.com/callstack/agent-device/blob/93b40d7/packages/daemon/src/sessions/session-lifecycle/internal/session-close-lifecycle-teardown.ts#L100), so a lost claim under a deny policy still warns that close would stop the device, which it would not; deciding claim currency once before both branches and deriving the warning and On the other open threads: the owner-wording thread (#4539 (comment)) is fixed at this head, and the resolved-benign thread on open-boot ownership (#4539 (comment)) needs nothing more, since this change touches only the close-side claim check. Two other threads do not apply and can be resolved: #4539 (comment) (on Darwin iOS the device is refreshed before reopen, and on Android the reopen re-mark is idempotent, so the proposed The only check not passing is a review gate that is holding open thread r4578158108. That thread does not apply, so the gate needs a waiver or a reply on that thread, not a code change. The other 17 checks pass. Before merge, please attach the three live Android runs above. |
|
This branch now conflicts with main at 93b40d7. Please rebase onto main and push, together with the live Android runs from the earlier review, and I will re-check the new head. |
93b40d7 to
0e19c8d
Compare
|
This follows up on the earlier review at 93b40d7 (#4539 (comment)). The rebase to 0e19c8d keeps the same logical patch, so the earlier trace of the open and close route still holds. One gap remains: the Android cold-open route has no live run. The route boots by AVD name, swaps the AVD name for an ADB serial, and records bootedByOpen in session-open-execution.ts:443. Close then needs the claim renewal at session-close-lifecycle-teardown.ts:105 to return 'renewed' for a claim written before that swap. Only unit fakes cover this. The PR body still lists Android cold-open, claim, implicit-stop and the current-client warning as live gaps, and the earlier Pixel 7 DEVICE_NOT_FOUND failure is still not explained. If the swap drops bootedByOpen, or the renewal reports 'lost', plain close leaves the emulator running with no data.shutdown and no warning. That is the #4162 failure on Android, and it would ship silently. Please run Of the other open threads, the Darwin iOS reopen thread does not apply. The device is refreshed before reopen on iOS, and the Android re-mark is idempotent (session-open-execution.ts:273-284, session-store.ts:423), so a source==='local' guard would drop real reopen boots. The client-app.ts thread also does not apply. A skipped stop already shows as absent data.shutdown plus the kept-running warning (session-close-lifecycle-teardown.ts:100-105). Please resolve both. The checks show 18 passing at 0e19c8d and none failing. There are no conflicts. The device lanes do not run the Android cold-open lifecycle with a live boot-owned close, so green CI does not replace the runs above. Before merge, the three live Android runs must be attached. Not blocking: if an older @agent-device/replay plugin can run against this daemon, cleanup warnings returned through ReplayTestCleanupSession would be dropped by that older runtime. |
Plain close now stops a local simulator or emulator that this session's open booted. The boot fact selection already computes (markSelectionBootOccurred) is recorded on the session by the open-state publisher, and close finalization asks the same shutdown capability close --shutdown uses. A policy that denies device-shutdown blocks the implicit stop but the close still succeeds and reports the kept device through warnings. A boot-owned iOS close no longer retains a warm runner, because the device stops. Closes #4162
R7 classifies bootedByOpen as store-established: publishOpenSession builds the record and SessionStore.markOpenBootedDevice sets the fact, matching the markCloseEffectsUnconfirmed shape.
Help, workflow topics, website docs, skills, device verification, and ADR 0029 now state that plain close stops the device its own open booted, that --shutdown is for a device the session did not boot, and how a policy denial reads on each of those paths.
The contract pinned the pre-#4162 wording 'agent-device close --shutdown'. Plain close now owns the boot-stop, so the contract anchors on the finish instruction itself, and the mutation fixture still removes exactly that.
Review round 1 on #4162: - A policy that denies device-shutdown is now a request-scoped fact the router marks once. The close lifecycle decides the refusal before it finalizes, so the refused stop never consumes the warm-runner retention a kept-running device earns, and no error is swallowed. - The boot-ownership fact is additive across every publish path, so a provisional dispatch publish (record-video test opens) cannot lose it. - SessionCloseResult and AppCloseResult carry the close response's warnings, and serializeCloseResult keeps them, so the kept-device disclosure reaches the SDK, the CLI text, and close --json. - remote-proxy.md states the plain-close exception to the denied capability, and the layering note names the real writer.
The close lifecycle consumes the derived request flag, not the predicate, so the export has no consumer outside daemon-policy.ts.
0e19c8d to
16f77f9
Compare
|
The code at 16f77f9 has one open gap: the Android cold-open close route still has no live run. The duplicate warning plumbing is gone, and nothing in that change looks wrong. The live evidence I asked for at 0e19c8d is still missing. The Android cold-open route boots by AVD name and stamps The two open inline threads on the cold-open boot stamp do not apply, so you can resolve them. The first (thread) is the external-reboot case: your 12:01Z reply moves it to #4585, and the exclusive claim still protects #4162. The second (thread) asks for a CI is unclear at 16f77f9. One check failed and seven are still running. 'Smoke Tests' failed in run 43953240485, but three workflows use that job name (android.yml, linux.yml, apple.yml), so which one failed is not attributed yet. The Android smoke job overlaps this PR, since it replays steps on a prebooted emulator, so please check it first. All checks were green at 0e19c8d. There are no conflicts. Before merge, please post the three live Android runs at 16f77f9 and get the failed Smoke Tests job explained or green. |
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 16f77f9. The verdict and the full list are in the summary comment.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 1a4ddaa. The verdict and the full list are in the summary comment.
|
The earlier request at 16f77f9 is partly addressed at 1a4ddaa. A lost claim now emits a claim-lost warning instead of a silent skip, and the policy warning no longer fires when the claim is lost. The earlier Smoke Tests failure is gone, and hosted checks show 18 checks with none failing. There are no conflicts. The Android cold-open route still has no live run. It boots by AVD name, stamps bootOccurred, swaps the AVD name for the ADB serial in updateOpenDevice, and at close needs renewDeviceClaim to return renewed for a claim written before that swap (session-close-lifecycle-teardown.ts#L102). Every implicit close now goes through that renewal before the policy check. If the swap or renewal misbehaves on a real emulator, plain close returns the claim-lost warning and leaves a cold-booted emulator running, which is the #4162 failure on Android. Only unit fakes cover this route, and green CI does not boot an emulator. The three runs requested at 0e19c8d and 16f77f9 are not posted for 1a4ddaa. Please run On the open threads: the claim-lost warning thread is fixed at this head, so please resolve it. The bootOccurred thread does not apply, because bootOccurred is a required boolean and a same-identity reopen keeps bootedByOpen through retainsBoot. The external-reboot case is tracked in #4585. Once the three live runs are posted, nothing else is open from this pass. |
Summary
For #4162, plain close stops a local virtual device booted by this session’s
openwhen its claim remains current. Prebooted, physical, and provider-owned targets are excluded. Policy denial skips the implicit stop and reports it. A lost claim also skips the stop and reports that no stop was requested, without assuming the device state; a successor claim remains protected. Existing remote-script delivery and warning propagation through replay are retained.Validation
Head
1a4ddaa11bc13ccbea3e7a6ce70d3d9166e73868.exactCommit=trueandcheckoutChanged=false.v0.21.38.31fc8dfbproduces a conflict-free merge tree. A4 lifecycle changes and warning transport were source-inspected; no combined-head gate or live client result is claimed.Hosted checks for this head remain pending. The earlier Android smoke job failed while installing the emulator ZIP before launch; one focused rerun was requested. Startup performance requires controlled follow-up.
Android cold-open/claim/implicit-stop and current-client warning delivery still require live evidence. External emulator restart remains tracked in #4585 without a runtime reproduction or fix. Existing Pixel 7 and Pixel 9 stopped routes remain blocked. No merge or release clearance.