refactor(daemon): separate open-target policy from mechanics - #2408
refactor(daemon): separate open-target policy from mechanics#2408PLASMA-FR wants to merge 3 commits into
Conversation
|
Please preserve the no-target fast return in inferOpenedAppBundleId. It now loads Android mechanics before the helper can return for an absent target, so a loader failure can turn a fresh targetless Android open into an error instead of leaving the optional package identity unset. Keep loading inside the best-effort operation and add a targetless regression with the loader rejecting. This also overlaps #2416 on #2334; these are alternative implementations, not two changes to merge. Checks are green on 85e9fa2. |
|
The inference correction looks good at 1f6edf6: early returns avoid loading Android mechanics, and loader failures remain best-effort. The iOS failure is likely unrelated—it is in an unchanged native alert-observation test. This and #2416 solve the same issue; choose one before marking it ready to merge. |
|
Closing in favor of #2416 — both PRs implement #2334 independently; thymikee reviewed both and chose #2416 (see callstack/agent-device#2416 (comment)) to avoid merging two alternative implementations of the same issue. Generated by Claude Code |
|
Correction to my comment above: the specific comment anchor I linked doesn't exist. The decision is recorded in the thread on callstack/agent-device#2416 (thymikee's comments there choosing that implementation). Generated by Claude Code |
Summary
Closes #2334.
Session identity planning and lifecycle opens share the application tools'
resolveOpenTargetresult. Android package lookup and foreground inference live inpackages/platform-android; Apple observations stay behind Apple application tools. The daemon supplies no Android resolver, and surface/relaunch policy is preserved.The requested correction restores the no-target/existing-identity fast return and keeps mechanics loading inside best-effort post-open inference. Five cases cover early returns, loader rejection, and successful inference.
21 files (+374/−246), including tests, ADR 0022, and the R76 inventory. This is an alternative to #2416, not an additional change to merge alongside it.
Validation
Head:
1f6edf6f525b71c33d19b3527150580549f46f2c(Linux arm64, Node 26.8.1, pnpm 11.17.0).e7d97f7dfe, failed on prior PR head85e9fa2, and pass with the correction.pnpm exec vitest run: 90 tests passed across application-tools, window-state, lifecycle, target-planning, and seven archive/provider suites.pnpm check:affected --run: passed, including 2,246 tests across 329 files, 95 Node integration tests, lint/types, layering, Fallow, build/package validation, and compatibility. Nine native cases were skipped by the repository harness.Initial local failures were missing
zip/unzipand release tags; provisioning them resolved both. CI is pending on the updated head; full coverage and native/device lanes remain GitHub-authoritative.