Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(providers): namespace-import service modules in core, Muse, Pi, and testing #17375

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/17375/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Our Effect service conventions say to import a service module as a namespace, and that covers its errors, helpers, and types as well as the service class. The provider packages already on main (provider-core, Muse, Pi, provider-testing) still imported ProviderHost, ProviderAdapter, ProviderEventLoggers, and IdAllocator by name.

This switches those imports to namespace imports, for example ProviderHost.ProviderHost, ProviderAdapter.ProviderAdapterV2Shape, and IdAllocator.IdAllocatorV2Shape. It doesn't change behavior. Plain utility modules (camelCase, no service) keep named imports, as the guide allows.

The open provider-packages stack (#17345 → #17349 → #17354 → #17357) applies the same rule to the layers it adds. This PR handles the code that already merged so it doesn't have to wait on that stack.

Verification: typecheck is clean for provider-core, provider-muse, provider-pi, provider-testing, and server. vp lint and knip pass on those packages. All 339 tests in the four packages pass.

Done by Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code


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

    2. juliusmarminge added labelsmacroscope-review

    3. Approvability

      Verdict: Approved at 31cd548

      Macroscope's review found this PR approvable — The PR consistently converts existing provider service imports to namespace imports without changing service implementations, schemas, defaults, or execution paths. Runtime references preserve the same exported classes, and the remaining changes are type-only or test-only.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. 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: 3c3c4e92-e1df-4e10-a943-8950ad0db663
      📥 Commits

      Reviewing files that changed from the base of the PR and between b0ee7dd48f868c5c02884345f723bebaf616b13d and 31cd5485c9b5183c5dece2b28b83729ce0f7c07f.

      📒 Files selected for processing (14)
      • packages/provider-core/src/server/adapterDriver.ts
      • packages/provider-core/src/server/driver.ts
      • packages/provider-core/src/server/failure.test.ts
      • packages/provider-core/src/server/failure.ts
      • packages/provider-core/src/server/managedProvider.test.ts
      • packages/provider-core/src/server/managedProvider.ts
      • packages/provider-core/src/server/snapshotSettings.ts
      • packages/provider-muse/src/server/adapter.test.ts
      • packages/provider-muse/src/server/adapter.ts
      • packages/provider-muse/src/server/driver.ts
      • packages/provider-pi/src/server/adapter.test.ts
      • packages/provider-pi/src/server/adapter.ts
      • packages/provider-pi/src/server/driver.ts
      • packages/provider-testing/src/host.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


      📝 Walkthrough

      Walkthrough

      Provider type, service, and constructor references now use namespace-qualified imports across provider-core, provider-muse, provider-pi, and provider-testing. The changes update declarations and tests without changing the underlying types or runtime behavior.

      Changes

      Provider namespace qualification

      Layer / File(s)Summary
      Qualify provider contracts and services
      packages/provider-core/src/server/*, packages/provider-muse/src/server/*, packages/provider-pi/src/server/*, packages/provider-testing/src/host.ts
      Provider adapter, host, event logger, and ID allocator references now use namespace-qualified names. Tests use the same qualified references. The existing types and runtime behavior remain unchanged.

      Priority: ⬇️ Low

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

      Change: Refactor

      Merge Risk: ⚪ Minimal · up to 31cd5

      This change is a provider import refactor, and the supplied summaries identify no behavior or contract regression. No actionable merge-blocking risk remains.

      🚥 Pre-merge checks | ✅ 4
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: namespace-importing service modules across the provider packages.
      Description checkPassedThe description explains the convention, affected packages, unchanged behavior, scope, verification results, and agent attribution. It does not use the template's explicit section headings or provide …
      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.
      ✨ Finishing Touches
      📝 Generate docstrings
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    5. juliusmarminge merged this2c7a446

    6. juliusmarminge closed this

    7. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB−24 B (−0.5%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB−24 B (−2.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB−41 B (−0.2%)29.3 KiB✅
      ClaudeLive turn messages21−1 (−50.0%)8✅

      Baseline: b0ee7dd · PR result: 31cd548 · 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.

Sign in to join this conversation.