Skip to content

refactor(server): classify preview toolkit exports - #10281

Merged
juliusmarminge merged 1 commit into
cleanup-server/source-control-registryfrom
cleanup-server/mcp-preview-internals
Sep 8, 2026
Merged

refactor(server): classify preview toolkit exports#10281
juliusmarminge merged 1 commit into
cleanup-server/source-control-registryfrom
cleanup-server/mcp-preview-internals

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 6, 2026

Copy link
Copy Markdown
Member

The MCP preview toolkit had 14 unclassified runtime exports. This keeps each tool definition private to its toolkit assembly and removes the unused broad handler layer while retaining the standard and snapshot handler layers used by the server.

This is layer 8 of 9 in the server Knip cleanup stack.

Verification after rebasing onto current main: server typecheck and the server-only Knip export audit pass. Changed-file lint and formatting pass, with one existing lint warning. Focused auth, provider, source-control, preview toolkit, orchestration, and Knip preprocessor tests pass: 90 tests across 9 files. This changes server export visibility and static analysis; screenshots do not apply.

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

Summary by CodeRabbit

  • Refactor
    • Simplified the preview toolkit’s internal structure without changing the behavior or schemas of available preview tools.
    • Preview tool definitions are no longer individually exposed through the public interface, while snapshot functionality remains available.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 6, 2026
@juliusmarminge juliusmarminge changed the title refactor(server): keep preview toolkit internals private refactor(server): classify preview toolkit exports Sep 6, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at e67ad63

Macroscope's review found this PR approvable — This is a small server-internal refactor that hides unused preview implementation symbols while preserving the exported toolkits and the existing standard/snapshot registration paths. No product defaults, runtime schemas, deployment behavior, or static-analysis configuration are changed.

No code changes detected at 210288f. Prior analysis still applies.

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

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

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

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.3 KiB
Codex Live turn WebSocket wire 6.6 KiB 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 66.4 KiB
Codex Live turn messages 10 21
Claude Total thread wire 13.6 KiB 15.1 KiB
Claude Thread snapshot wire 7.1 KiB 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 7.8 KiB
Claude Live turn WebSocket decoded 57.9 KiB 66.4 KiB
Claude Live turn messages 10 21

Baseline: unavailable · PR result: 210288f · 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.

@juliusmarminge
juliusmarminge force-pushed the cleanup-server/mcp-preview-internals branch 2 times, most recently from 340a302 to bde41cd Compare September 8, 2026 07:53
@juliusmarminge
juliusmarminge force-pushed the cleanup-server/mcp-preview-internals branch from bde41cd to 72f32c8 Compare September 8, 2026 07:53
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview 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: Advanced

Run ID: 6415c9ab-ad35-4389-ab1b-18830fc08587

📥 Commits

Reviewing files that changed from the base of the PR and between b0e2bc4 and 72f32c8.

📒 Files selected for processing (2)
  • apps/server/src/mcp/toolkits/preview/handlers.ts
  • apps/server/src/mcp/toolkits/preview/tools.ts
💤 Files with no reviewable changes (1)
  • apps/server/src/mcp/toolkits/preview/handlers.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The preview toolkit narrows its exported API. Individual preview tools remain available internally, and the combined live handler export is removed.

Changes

Preview toolkit exports

Layer / File(s) Summary
Narrow preview tool exports
apps/server/src/mcp/toolkits/preview/tools.ts, apps/server/src/mcp/toolkits/preview/handlers.ts
Preview tool constants are no longer individually exported. The toolkit retains their behavior and definitions. PreviewToolkitHandlersLive is removed while standard and snapshot layers remain available.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 21028

Preview toolkit internals are no longer publicly exported while existing toolkit behavior remains unchanged. No current merge-blocking risk is identified.

Suggested reviewers: maria-rcks, t3dotgg

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Title check ✅ Passed The title clearly and concisely describes the main change: classifying and reducing preview toolkit exports.
Description check ✅ Passed The description explains what changed, why the change was made, verification performed, and why screenshots do not apply. It does not use the template headings or checklist, but it provides the requir…
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup-server/mcp-preview-internals

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

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Sep 8, 2026
@juliusmarminge
juliusmarminge force-pushed the cleanup-server/mcp-preview-internals branch from 72f32c8 to eb192a3 Compare September 8, 2026 08:11
@juliusmarminge
juliusmarminge force-pushed the cleanup-server/mcp-preview-internals branch from eb192a3 to 210288f Compare September 8, 2026 08:12
@juliusmarminge
juliusmarminge merged commit 1f0a14c into main Sep 8, 2026
31 of 34 checks passed
@juliusmarminge
juliusmarminge deleted the cleanup-server/mcp-preview-internals branch September 8, 2026 08:17
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 8, 2026
## What's Changed
* feat(chat): attach files to question answers by @shivamhwp in pingdotgg/t3code#9871
* feat(desktop): refresh macOS installer with aurora artwork by @saphid in pingdotgg/t3code#10632
* fix(server): give completed turns a full session idle window by @StiensWout in pingdotgg/t3code#10689
* feat(web): add pull request merge defaults by @Bil0000 in pingdotgg/t3code#8088
* fix(usage): keep account columns aligned across limit rows by @juliusmarminge in pingdotgg/t3code#10690
* fix(web): chat text no longer shows through a 1px gap under composer banners by @vitalyiegorov in pingdotgg/t3code#10635
* refactor(server): classify runtime exports by @juliusmarminge in pingdotgg/t3code#10274
* refactor(server): classify orchestration exports by @juliusmarminge in pingdotgg/t3code#10275
* refactor(server): classify service exports by @juliusmarminge in pingdotgg/t3code#10276
* refactor(server): classify telemetry exports by @juliusmarminge in pingdotgg/t3code#10277
* refactor(server): classify provider exports by @juliusmarminge in pingdotgg/t3code#10278
* refactor(server): classify source control exports by @juliusmarminge in pingdotgg/t3code#10279
* refactor(server): classify source control registry API by @juliusmarminge in pingdotgg/t3code#10280
* refactor(server): classify preview toolkit exports by @juliusmarminge in pingdotgg/t3code#10281
* ci(knip): enforce server exports by @juliusmarminge in pingdotgg/t3code#10282
* feat(web): add previous/next turn navigation in minimap by @UtkarshUsername in pingdotgg/t3code#8531
* fix(web): stop the settings sidebar shifting when switching pages by @t3dotgg in pingdotgg/t3code#10705
* fix(web): copy terminal selection with Ctrl+Insert by @iamshadmantaqi in pingdotgg/t3code#8541
* fix(web): show the same project icon in the command palette as everywhere else by @t3dotgg in pingdotgg/t3code#10712
* fix(web): stop sidebar rows flashing and shifting on click by @t3dotgg in pingdotgg/t3code#10713
* refactor(web): pass the project record to ProjectFavicon so icons cannot drift by @t3dotgg in pingdotgg/t3code#10714

## New Contributors
* @iamshadmantaqi made their first contribution in pingdotgg/t3code#8541

**Full Changelog**: pingdotgg/t3code@v0.0.41-nightly.20260908.1387...v0.0.41-nightly.20260908.1400

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

Labels

size:S 10-29 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