refactor(server): classify provider exports#10278

merged2
cleanup-server/telemetry-usage-internals
cleanup-server/provider-internals
openedSep 6, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

Provider modules had 27 unclassified runtime exports. This marks four canonical Effect construction APIs as intentionally public, narrows implementation-only constants and helpers, removes redundant re-exports, and deletes two unused provider snapshot parsers.

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

The maintenance helper remains exported because current main imports it in behavior tests.

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

    • Reduced the publicly accessible surface of provider integrations and internal helpers by making implementation details private.
    • Removed several internal utilities and re-exports that were not intended for external use.
    • Existing provider behavior remains unchanged.
  • Documentation

    • Added and updated API documentation for service construction and bundled-data support.
    • Clarified public API annotations for select provider services.
Synced from GitHub

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โ€”13.6 KiBโ€”15.1 KiBโœ…
CodexThread snapshot wireโ€”7.0 KiBโ€”7.3 KiBโœ…
CodexLive turn WebSocket wireโ€”6.6 KiBโ€”7.8 KiBโœ…
CodexLive turn WebSocket decodedโ€”57.1 KiBโ€”66.4 KiBโœ…
CodexLive turn messagesโ€”10โ€”21โœ…
ClaudeTotal thread wireโ€”13.6 KiBโ€”15.1 KiBโœ…
ClaudeThread snapshot wireโ€”7.0 KiBโ€”7.3 KiBโœ…
ClaudeLive turn WebSocket wireโ€”6.5 KiBโ€”7.8 KiBโœ…
ClaudeLive turn WebSocket decodedโ€”57.8 KiBโ€”66.4 KiBโœ…
ClaudeLive turn messagesโ€”9โ€”21โœ…

Baseline: unavailable ยท PR result: 375ccee ยท 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.

Synced from GitHub

Approvability

Verdict: Approved at 375ccee

Macroscope's review found this PR approvable โ€” This is a contained server export-surface cleanup: runtime implementations and constants remain unchanged, while unused exports and redundant re-exports are removed and Effect API documentation is added. The published server artifact is a bundled CLI, and repository-wide references use the canonical modules directly.

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

Added 2 commits

  • refactor(server): remove unused provider exports2cd7618
  • fix(server): retain maintenance helper used by tests375ccee
Synced from GitHub

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: acbe1265-709f-4fbb-9f1f-aa923d7f59f1

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 71d237b15304d483225aa9c5136618396b38db12 and 375ccee2e02f7813c81301724d12be054af1e5b1.

๐Ÿ“’ Files selected for processing (19)
  • apps/server/src/provider/ClaudeModelCatalog.ts
  • apps/server/src/provider/Drivers/ClaudeSkills.ts
  • apps/server/src/provider/Layers/ProviderAdapterRegistry.ts
  • apps/server/src/provider/Layers/ProviderEventLoggers.ts
  • apps/server/src/provider/Layers/ProviderInstanceRegistryLive.ts
  • apps/server/src/provider/Layers/codexLaunchArgs.ts
  • apps/server/src/provider/Layers/codexResetCredit.ts
  • apps/server/src/provider/Layers/codexUsageLimits.ts
  • apps/server/src/provider/ModelManifest.ts
  • apps/server/src/provider/OpenCodeServerOwner.ts
  • apps/server/src/provider/acp/AntigravityAcpSupport.ts
  • apps/server/src/provider/acp/AntigravityProtocol.ts
  • apps/server/src/provider/antigravityRelease.ts
  • apps/server/src/provider/opencodeRuntime.ts
  • apps/server/src/provider/providerMaintenance.ts
  • apps/server/src/provider/providerMaintenanceRunner.ts
  • apps/server/src/provider/providerSnapshot.ts
  • apps/server/src/provider/providerUpdateSettings.ts
  • apps/server/src/provider/testUtils/providerRegistryMock.ts
๐Ÿ’ค Files with no reviewable changes (3)
  • apps/server/src/provider/providerSnapshot.ts
  • apps/server/src/provider/Layers/ProviderInstanceRegistryLive.ts
  • apps/server/src/provider/Layers/ProviderAdapterRegistry.ts

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


๐Ÿ“ Walkthrough

Walkthrough

Provider modules narrow their public API by making internal helpers and constants private, removing selected re-exports, deleting two snapshot helpers, and adding documentation for canonical service constructors.

Changes

Provider API cleanup

Layer / File(s)Summary
Service API surface and documentation
apps/server/src/provider/Layers/*
Selected provider re-exports are removed. Canonical Effect service constructors receive public API documentation.
Provider helper visibility
apps/server/src/provider/ClaudeModelCatalog.ts, apps/server/src/provider/Drivers/ClaudeSkills.ts, apps/server/src/provider/ModelManifest.ts, apps/server/src/provider/acp/*, apps/server/src/provider/opencodeRuntime.ts, apps/server/src/provider/providerMaintenance.ts, apps/server/src/provider/providerUpdateSettings.ts, apps/server/src/provider/providerSnapshot.ts, apps/server/src/provider/testUtils/providerRegistryMock.ts
Internal helpers and constants become module-private. detailFromResult and extractAuthBoolean are removed from providerSnapshot.ts.

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

Merge Risk: โšช Minimal ยท up to 375cc

This change narrows provider module APIs and documents canonical constructors without changing runtime behavior. No current merge-blocking risk is identified.

Suggested reviewers: t3dotgg

๐Ÿšฅ Pre-merge checks | โœ… 4 | โŒ 1

โŒ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverageโš ๏ธ WarningDocstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 16 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
โœ… Passed checks (4 passed)
Check nameStatusExplanation
Linked Issues checkโœ… PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkโœ… PassedCheck skipped because no linked issues were found for this pull request.
Title checkโœ… PassedThe title clearly and concisely describes the main change: classifying provider exports in the server.
Description checkโœ… PassedThe description explains the export refactor, its purpose, scope, retained API, verification, and the absence of UI changes. It does not reproduce the template headings or checklist, but it provides tโ€ฆ
  • 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-server/provider-internals

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