Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): skip unchanged device host refreshes #19961

Mergedjuliusmarmingemerged 2 commits intotakeover/android-sdk fromrefs/pull/19961/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

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


Devin Review
    1. juliusmarminge changed the title

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. juliusmarminge added labelsmacroscope-review

    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at d4afbf4

      Macroscope'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 68fa36c. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire—5.0 KiB—6.8 KiB✅
      CodexThread snapshot wire—3.8 KiB—4.9 KiB✅
      CodexLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      CodexLive turn WebSocket decoded—20.9 KiB—29.3 KiB✅
      CodexLive turn messages—2—8✅
      ClaudeTotal thread wire—5.0 KiB—6.8 KiB✅
      ClaudeThread snapshot wire—3.8 KiB—4.9 KiB✅
      ClaudeLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      ClaudeLive turn WebSocket decoded—21.2 KiB—29.3 KiB✅
      ClaudeLive turn messages—2—8✅

      Baseline: unavailable · PR result: 68fa36c · Source CI: success

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

    6. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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.ts
      • apps/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.ts
      reconcile refreshes 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: Passed 4
      Check nameStatusExplanation
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Title checkPassedThe title clearly and concisely describes the main change: skipping unchanged device host refreshes.
      Description checkPassedThe 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
      Comment `@coderabbitai help` to get the list of available commands.
    7. juliusmarminge merged this9a067b2

    8. juliusmarminge closed this

Sign in to join this conversation.