Skip to content

refactor(desktop): classify backend exports - #10265

Merged
juliusmarminge merged 1 commit into
mainfrom
cleanup-desktop/runtime-core
Sep 7, 2026
Merged

refactor(desktop): classify backend exports#10265
juliusmarminge merged 1 commit into
mainfrom
cleanup-desktop/runtime-core

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 6, 2026

Copy link
Copy Markdown
Member

Desktop backend, settings, telemetry, WSL, and launcher modules had 15 unclassified runtime exports. This marks eight canonical Effect service constructors as intentional public APIs, narrows seven implementation exports, and removes an unused 53-line saved-environments test layer. Exported types and schemas remain unchanged.

This is layer 1 of 5 in the desktop Knip cleanup stack.

Verification after the full stack: desktop typecheck; desktop Knip export audit; 831 desktop tests; changed-file lint and format checks. The native libsecret test cannot start on this machine because the system libsecret-1 development package is unavailable.

Model: gpt-6 astra. Harness: Codex in T3 Code.

Note

Tighten desktop backend export surface and document service constructors

  • Removes named exports for constants and helpers in electron-launcher.mjs, DesktopServerExposure.ts, tailscaleEndpointProvider.ts, and DesktopAppSettings.ts, keeping their internal definitions unchanged.
  • Adds API doc comments to the .make service construction values across the desktop backend modules.
  • Removes the in-memory DesktopSavedEnvironments.layerTest test layer and its mutable test-state implementations.
  • Risk: DesktopSavedEnvironments.layerTest removal may break out-of-tree tests that import it; in-tree tests should be updated accordingly.

Macroscope summarized fe8fffa.

Summary by CodeRabbit

  • Documentation

    • Added public API documentation across desktop backend, settings, telemetry, and WSL modules.
  • Refactor

    • Reduced the public API surface by keeping implementation constants and internal helpers private.
    • Removed an internal test-only environment layer.
    • Limited endpoint utility re-exports to the supported parsing functionality.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 6, 2026
@juliusmarminge juliusmarminge changed the title cleanup desktop/runtime core refactor(desktop): keep backend helpers private Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.6 KiB +2 B (+0.0%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −7 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.6 KiB 6.6 KiB +9 B (+0.1%) 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 57.1 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 10 10 0 (0.0%) 21
Claude Total thread wire 13.6 KiB 13.6 KiB −19 B (−0.1%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB +2 B (+0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.5 KiB −21 B (−0.3%) 7.8 KiB
Claude Live turn WebSocket decoded 57.9 KiB 57.9 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 10 10 0 (0.0%) 21

Baseline: 0d34579 · PR result: fe8fffa · 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: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at d12e01b

Macroscope's review found this PR approvable — This is a contained cleanup of internal exports and Effect API annotations; runtime logic and the existing product defaults remain unchanged. The removed code is an unused test-only layer, with no production request path or user-facing behavior affected.

No code changes detected at fe8fffa. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

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

Cross-cutting: the same export const makeconst make change is applied to eight service modules that own their construction (DesktopBackendConfiguration.ts:740, DesktopLocalEnvironmentAuth.ts:45, DesktopNetworkInterfaces.ts:42, DesktopServerExposure.ts:414, DesktopAppSettings.ts:453, DesktopSavedEnvironments.ts:367, DesktopTelemetryPublisher.ts:148, DesktopWslServerTree.ts:119). The inline note on the first occurrence applies to all eight; restoring export on each keeps the canonical module shape consistent. The un-exported constants (DESKTOP_LOOPBACK_HOST, DEFAULT_TAILSCALE_SERVE_PORT) and the removed unused layerTest are not service-shape exports and are fine as-is.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/desktop/src/backend/DesktopBackendConfiguration.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the cleanup-desktop/runtime-core branch from b6306d8 to d12e01b Compare September 6, 2026 04:15
@juliusmarminge juliusmarminge changed the title refactor(desktop): keep backend helpers private refactor(desktop): classify backend exports Sep 6, 2026
@juliusmarminge
juliusmarminge force-pushed the cleanup-desktop/runtime-core branch from d12e01b to fe8fffa Compare September 7, 2026 21:55
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 84d83483-d538-4c71-ab5a-e48cef53c740

📥 Commits

Reviewing files that changed from the base of the PR and between 0d34579 and fe8fffa.

📒 Files selected for processing (10)
  • apps/desktop/scripts/electron-launcher.mjs
  • apps/desktop/src/backend/DesktopBackendConfiguration.ts
  • apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts
  • apps/desktop/src/backend/DesktopNetworkInterfaces.ts
  • apps/desktop/src/backend/DesktopServerExposure.ts
  • apps/desktop/src/backend/tailscaleEndpointProvider.ts
  • apps/desktop/src/settings/DesktopAppSettings.ts
  • apps/desktop/src/settings/DesktopSavedEnvironments.ts
  • apps/desktop/src/telemetry/DesktopTelemetryPublisher.ts
  • apps/desktop/src/wsl/DesktopWslServerTree.ts

Included review availability: 5 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

The change narrows desktop module exports, adds public API annotations to service constructors, and removes the exported in-memory test layer from saved environments.

Changes

Desktop API cleanup

Layer / File(s) Summary
Restrict internal exports
apps/desktop/scripts/electron-launcher.mjs, apps/desktop/src/backend/DesktopServerExposure.ts, apps/desktop/src/backend/tailscaleEndpointProvider.ts, apps/desktop/src/settings/DesktopAppSettings.ts
Selected constants, resolveElectronPath, and isTailscaleIpv4Address are no longer publicly exported.
Document service construction APIs
apps/desktop/src/backend/*.ts, apps/desktop/src/settings/DesktopAppSettings.ts, apps/desktop/src/telemetry/DesktopTelemetryPublisher.ts, apps/desktop/src/wsl/DesktopWslServerTree.ts
Public documentation annotations identify the canonical service construction APIs.
Remove the saved-environment test layer
apps/desktop/src/settings/DesktopSavedEnvironments.ts
The exported layerTest implementation and unused Ref import are removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fe8ff

This change narrows desktop implementation exports, documents supported service constructors, and removes an unused test helper without changing production behavior. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change: classifying and narrowing desktop backend exports.
Description check ✅ Passed The description clearly explains the export changes, rationale, scope, verification, and known test limitation. It omits the template headings and checklist, but the required information is mostly pre…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup-desktop/runtime-core

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge merged commit 5b8a69c into main Sep 7, 2026
24 checks passed
@juliusmarminge
juliusmarminge deleted the cleanup-desktop/runtime-core branch September 7, 2026 22:00
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 8, 2026
## What's Changed
* fix(mobile): keep pending messages in the chat timeline by @juliusmarminge in pingdotgg/t3code#10449
* fix(mobile): show connection status in the floating pill instead of a second one by @juliusmarminge in pingdotgg/t3code#10440
* fix: use Pierre icons consistently for attachments by @juliusmarminge in pingdotgg/t3code#10475
* feat(mobile): open the thread screen as soon as a new task is submitted by @juliusmarminge in pingdotgg/t3code#10435
* fix(devcontainer): make repository setup work by @saphid in pingdotgg/t3code#7875
* fix(projects): prevent invalid script IDs from crashing threads by @saphid in pingdotgg/t3code#10019
* fix(mobile): hide changed-files navigator and restore refresh in raw diff fallback by @lnieuwenhuis in pingdotgg/t3code#9828
* fix(ios): scroll short source files from blank space by @juliusmarminge in pingdotgg/t3code#10178
* feat(mobile): start a new thread on an existing branch by @StiensWout in pingdotgg/t3code#10359
* fix(mobile): improve font-size slider performance and prevent maximum update depth errors by @bbernag in pingdotgg/t3code#7138
* fix(web): keep composer toolbar controls anchored during transitions by @juliusmarminge in pingdotgg/t3code#10478
* fix(web): resize the floating preview from any edge by @juliusmarminge in pingdotgg/t3code#10467
* fix(mobile): prevent chat from disappearing when scrolling by @juliusmarminge in pingdotgg/t3code#10479
* fix(mobile): smooth composer status pill resizing by @juliusmarminge in pingdotgg/t3code#10484
* fix(mobile): release initial scroll target after dragging by @juliusmarminge in pingdotgg/t3code#10483
* fix(mobile): animate thread lifecycle transitions consistently by @juliusmarminge in pingdotgg/t3code#10487
* fix(mobile): restore assistant message bottom padding by @juliusmarminge in pingdotgg/t3code#10491
* fix(mobile): preserve chat rows when toggling commands by @juliusmarminge in pingdotgg/t3code#10492
* feat(web): group onboarding project import by repository by @t3dotgg in pingdotgg/t3code#10493
* fix(web): remove inserted citations on cancel by @extoci in pingdotgg/t3code#10518
* fix(mobile): match Working status color to desktop by @baptisteArno in pingdotgg/t3code#10515
* fix(mobile): wait for native thread scroll before reveal by @juliusmarminge in pingdotgg/t3code#10486
* fix(web): tolerate servers that predate git identity in project import by @juliusmarminge in pingdotgg/t3code#10547
* fix(web): restore settled PR colors on hover by @flamboh in pingdotgg/t3code#10023
* fix(web): keep popup triggers steady when pressed by @dominic-r in pingdotgg/t3code#10468
* fix(web): keep project favicon shape consistent across sizes by @sameerr03 in pingdotgg/t3code#10502
* fix(claude): report usage limits on retried turns by @StiensWout in pingdotgg/t3code#10549
* refactor(desktop): classify backend exports by @juliusmarminge in pingdotgg/t3code#10265
* refactor(desktop): classify electron exports by @juliusmarminge in pingdotgg/t3code#10266
* refactor(desktop): classify app exports by @juliusmarminge in pingdotgg/t3code#10267
* refactor(desktop): classify preview exports by @juliusmarminge in pingdotgg/t3code#10268
* ci(knip): enforce desktop exports by @juliusmarminge in pingdotgg/t3code#10269
* fix(web): remove excess sidebar thread spacing by @maria-rcks in pingdotgg/t3code#10569
* fix(web): make settings project scopes searchable and scrollable by @maria-rcks in pingdotgg/t3code#10570
* fix(web): use `tabular-nums` with the ui font for sidebar timer by @extoci in pingdotgg/t3code#10592
* fix(web): correct pending question attachment message by @dominic-r in pingdotgg/t3code#10599
* fix(mobile): restore brand artwork in the Android adaptive icon by @juliusmarminge in pingdotgg/t3code#10598
* fix(mobile): configure iOS Keychain access group by @VedankPurohit in pingdotgg/t3code#3665
* fix(web): remember Composer Fast mode across new chats by @aravhawk in pingdotgg/t3code#2981
* fix(server): disable executable capabilities in Claude metadata generation by @maxwellyoung in pingdotgg/t3code#4169
* Add stop thread keybinding command by @jakeleventhal in pingdotgg/t3code#4308

## New Contributors
* @bbernag made their first contribution in pingdotgg/t3code#7138
* @baptisteArno made their first contribution in pingdotgg/t3code#10515
* @aravhawk made their first contribution in pingdotgg/t3code#2981

**Full Changelog**: pingdotgg/t3code@v0.0.39...v0.0.40

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.40
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 8, 2026
## What's Changed
* fix(mobile): wait for native thread scroll before reveal by @juliusmarminge in pingdotgg/t3code#10486
* fix(web): tolerate servers that predate git identity in project import by @juliusmarminge in pingdotgg/t3code#10547
* fix(web): restore settled PR colors on hover by @flamboh in pingdotgg/t3code#10023
* fix(web): keep popup triggers steady when pressed by @dominic-r in pingdotgg/t3code#10468
* fix(web): keep project favicon shape consistent across sizes by @sameerr03 in pingdotgg/t3code#10502
* fix(claude): report usage limits on retried turns by @StiensWout in pingdotgg/t3code#10549
* refactor(desktop): classify backend exports by @juliusmarminge in pingdotgg/t3code#10265
* refactor(desktop): classify electron exports by @juliusmarminge in pingdotgg/t3code#10266
* refactor(desktop): classify app exports by @juliusmarminge in pingdotgg/t3code#10267
* refactor(desktop): classify preview exports by @juliusmarminge in pingdotgg/t3code#10268
* ci(knip): enforce desktop exports by @juliusmarminge in pingdotgg/t3code#10269
* fix(web): remove excess sidebar thread spacing by @maria-rcks in pingdotgg/t3code#10569
* fix(web): make settings project scopes searchable and scrollable by @maria-rcks in pingdotgg/t3code#10570
* fix(web): use `tabular-nums` with the ui font for sidebar timer by @extoci in pingdotgg/t3code#10592
* fix(web): correct pending question attachment message by @dominic-r in pingdotgg/t3code#10599
* fix(mobile): restore brand artwork in the Android adaptive icon by @juliusmarminge in pingdotgg/t3code#10598
* fix(mobile): configure iOS Keychain access group by @VedankPurohit in pingdotgg/t3code#3665
* fix(web): remember Composer Fast mode across new chats by @aravhawk in pingdotgg/t3code#2981
* fix(server): disable executable capabilities in Claude metadata generation by @maxwellyoung in pingdotgg/t3code#4169
* Add stop thread keybinding command by @jakeleventhal in pingdotgg/t3code#4308

## New Contributors
* @aravhawk made their first contribution in pingdotgg/t3code#2981

**Full Changelog**: pingdotgg/t3code@v0.0.40-nightly.20260907.1359...v0.0.40-nightly.20260907.1372

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.40-nightly.20260907.1372
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant