perf(server): skip unchanged device host refreshes #19961
takeover/android-sdk fromrefs/pull/19961/head·merged by juliusmarminge View on GitHubSaving unchanged SSH device-host settings refreshed host summaries and published a new revision. Refresh only when a host was added or removed. Keep the refresh after removed host scopes close so late status writes cannot leave stale host state.
Rebuilt from Max Weinbach's #18522, keeping host reconciliation separate from Android SDK discovery.
Scope and approval#
This is maintainer-owned work taken over at Julius's explicit request. It replaces one concern from #18522 following the maintainer request to split that PR. The takeover notice records the plan. This PR contains only the behavior described above and its focused regression tests.
Verification: 26 DeviceService tests pass. The new regression fails on the base for unchanged settings and checks addition/removal state and stale-status cleanup. Scoped lint and server typecheck pass. Independently reviewed by Opus 5.5 and GPT-6.1 Sol. The post-close race was inspected in source; the test does not reproduce a concurrent late writer.
Implemented with Claude Fable 5.1 and reviewed with Claude Opus 5.5 and GPT-6.1 Sol through T3 Code.
- 1
juliusmarminge changed the title
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Approved at
d4afbf4Macroscope's review found this PR approvable — This is a small, localized server performance optimization that suppresses redundant device-host state publications while preserving refreshes for additions, removals, and stale-status cleanup. The accompanying changes are test-only coverage with no schema, default, infrastructure, or sensitive-package impact.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
No code changes detected at
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).68fa36c. Prior analysis still applies.Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
ℹ️ No successful
mainbaseline artifact is available yet. This run establishes the initial measurement.Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire — 5.0 KiB — 6.8 KiB ✅ Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅ Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅ Codex Live turn WebSocket decoded — 20.9 KiB — 29.3 KiB ✅ Codex Live turn messages — 2 — 8 ✅ Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅ Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅ Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅ Claude Live turn WebSocket decoded — 21.2 KiB — 29.3 KiB ✅ Claude Live turn messages — 2 — 8 ✅ Baseline: unavailable · PR result:
68fa36c· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
ec25789f-2f88-45bf-b58c-b27934b3914a
📥 Commits
-
Reviewing files that changed from the base of the PR and between d27abaa40029a1ad2b68cf16c4b69e7621896797 and d4afbf45b367914a21624a41a56759b4b03312b0.
📒 Files selected for processing: 2
-
apps/server/src/device/DeviceService.test.tsapps/server/src/device/DeviceService.ts
Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.
-
📝 Walkthrough
-
Reconciliation now refreshes host state only when the configured-host set changes. A new test checks unchanged settings, host addition, and host removal, including status clearing and file cleanup.
Changes: SSH host reconciliation
Layer / File(s) Summary Conditional refresh and reconciliation test
apps/server/src/device/DeviceService.ts,apps/server/src/device/DeviceService.test.tsreconcilerefreshes host state only when a host was added or removed. The test checks unchanged settings, host addition, and host removal, including status clearing and one file cleanup.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
pixpmusic
Merge Risk: ⚪ Minimal · up to
d4afb-
Saving unchanged SSH device-host settings no longer triggers a refresh or a new revision. Adding and removing hosts behave as before. No merge-blocking risk was found.
Pre-merge checks:
4-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check The title clearly and concisely describes the main change: skipping unchanged device host refreshes. Description check The description explains the problem, implementation, scope approval, and verification results. It does not use explicit Problem and Change headings, but it still provides the required information in …
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge merged this9a067b2
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes