Skip to content

refactor(daemon): require composed router capabilities - #3639

Merged
thymikee merged 2 commits into
mainfrom
refactor/require-router-capabilities
Oct 15, 2026
Merged

thymikee merged 2 commits into
mainfrom
refactor/require-router-capabilities

Conversation

@thymikee

@thymikee thymikee commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Require Android observation and platform-resource cleanup at router construction, where root composition supplies both. Delete throwing substitutes and retain test-owned defaults and overrides.

Five files changed. Review follow-up applies defaults during destructuring so explicit undefined behaves like omission. Cleanup mechanics and session lifecycle are unchanged.

Validation

Tested head: 6b69d4b21e91b5c5438ad29d7197f020618f8bbd; rebased onto 22ae872676 including the shared Coverage-gate repair from #3653.

  • pnpm check:affected --base 22ae872676 --head 6b69d4b21e --run: passed.
  • Router/open-claim suites: 20 passed. The same close releases the session lease regression, with new cases retained:
base bbc51ba900 default order head 6b69d4b21e
1 failed, 1 passed 2 passed

Fresh review found no actionable production issue. The prior iOS job failed during daemon startup before command dispatch; the new head will rerun its real smoke lane. CI checks must pass before merge.

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

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.24 MB 5.25 MB +11.5 kB
Package (unpacked) 5.24 MB 5.25 MB +11.5 kB
Package (download) 1.57 MB 1.58 MB +3.4 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.3 ms 28.4 ms +0.1 ms
CLI --help 77.9 ms 80.4 ms +2.5 ms

@thymikee

Copy link
Copy Markdown
Member Author

The code in 5591c28 looks right to me. The router now requires its composed capabilities, and I found no construction site that still omits them. I did not run tsc or the test suites. I relied on a search of every createRequestHandler and RequestRouterDeps user at that commit.

CI is still pending. Six checks (Lint & Format, Repo Guards, Integration, Smoke, Coverage and one more) are queued, and none has failed. Those lanes exercise the router type, the daemon-runtime Pick type and the test fixtures, so a missed construction site would show up there.

Not blocking: in test-device-runtime-gateway.ts, androidObservation and platformResourceCleanup are defaulted before ...rest, while the other four optional fields are defaulted by destructuring. An explicit undefined would now reach the production router with no fallback. Moving both defaults into the destructuring would give one rule for all six fields. Take it or leave it.

The open inline thread on that wrapper (#3639 (comment)) still stands. It is the same default-ordering point, and no caller passes undefined today.

Before merge, the CI lanes need to finish green.

@thymikee
thymikee force-pushed the refactor/require-router-capabilities branch from 5591c28 to 6b69d4b Compare October 15, 2026 14:01
@thymikee

Copy link
Copy Markdown
Member Author

Investigated the size job at head 6b69d4b21e91b5c5438ad29d7197f020618f8bbd. Its detailed artifact accounts for the entire +11,502-byte unpacked delta:

  • dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentedSurface.swift: +11,983 bytes.
  • dist/src/internal/daemon.js: −481 bytes.

The comparison base is 35c21b618ace55f2313124190d5674ea174e6d8b, which includes the newer Apple simplification from #3632. This PR's merge base is 22ae872676213b27aeb97aeea1c83bbdecac9360; git diff 22ae872676 6b69d4b21e -- apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentedSurface.swift is empty. The Apple difference is base advancement outside this PR's five-file diff, rather than added Apple code in this change. The production daemon bundle shrank, and the successful Size job needs no code correction. Other required checks are still pending.

@thymikee

Copy link
Copy Markdown
Member Author

Investigated the Android smoke failure at 6b69d4b21e91b5c5438ad29d7197f020618f8bbd.

The fixture opened successfully. The first 10-second wait spent 4,085 ms installing the missing snapshot helper, then the request diagnostic recorded android_snapshot_helper_session_fallback with uiAutomationConnectionTimeout: true (Timed out waiting for Android UiAutomation to connect). Fallback exhausted the remaining wait budget without a readable capture. The captured post-failure snapshot contains the expected Automation lab label, the app is resumed, and the crash buffer is empty. Portrait restoration and session close both succeeded.

This explicit UiAutomation startup failure qualifies for the repository's single infrastructure retry. Reran only the failing Android job once; no source or timeout change. A repeated failure will be investigated as a finding rather than retried again. Merge readiness remains pending.

@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready as of 6b69d4b. The earlier findings from 5591c28 are fixed, and the router no longer has the throwing fallbacks. Not blocking, and you can take or leave these: the harness in test/integration/provider-scenarios/harness.ts spreads routerDeps after androidObservation and platformResourceCleanup, so an explicit undefined from a scenario would overwrite them (no caller passes either today), and the "Optionality mirrors RequestRouterDeps" comment in packages/daemon/src/server/http/daemon-runtime.ts now sits on a Pick that includes the required androidObservation.

The cubic-dev-ai thread on test-device-runtime-gateway.ts (#3639 (comment)) is fixed at this head: both fields now default in the destructuring before ...rest, and the close test covers an explicit undefined. Please resolve it.

I read the diff but ran no tests or type checks. The fixture and type completeness rests on reading the code and your base-vs-head table. CI is pending: the only checks not yet passing are three Smoke Tests, all queued and none failed, so the daemon start, open and close lane has not run on this head. I did not check your Android smoke failure analysis. No conflicts. The three Smoke Tests need to finish green on 6b69d4b before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 15, 2026
@thymikee
thymikee merged commit 78272a7 into main Oct 15, 2026
18 of 20 checks passed
@thymikee
thymikee deleted the refactor/require-router-capabilities branch October 15, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant