refactor(providers): namespace-import service modules in core, Muse, Pi, and testing #17375
main fromrefs/pull/17375/head·merged by juliusmarminge View on GitHubOur 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
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
juliusmarminge added labelsmacroscope-review
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Approvability#
Verdict: Approved at
31cd548Macroscope'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).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.tspackages/provider-core/src/server/driver.tspackages/provider-core/src/server/failure.test.tspackages/provider-core/src/server/failure.tspackages/provider-core/src/server/managedProvider.test.tspackages/provider-core/src/server/managedProvider.tspackages/provider-core/src/server/snapshotSettings.tspackages/provider-muse/src/server/adapter.test.tspackages/provider-muse/src/server/adapter.tspackages/provider-muse/src/server/driver.tspackages/provider-pi/src/server/adapter.test.tspackages/provider-pi/src/server/adapter.tspackages/provider-pi/src/server/driver.tspackages/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.tsProvider 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
31cd5This 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 name Status Explanation Title check The title clearly and concisely describes the main change: namespace-importing service modules across the provider packages. Description check The 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 check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check 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.juliusmarminge merged this2c7a446
juliusmarminge closed this
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB −24 B (−0.5%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB −24 B (−2.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB −41 B (−0.2%) 29.3 KiB ✅ Claude Live turn messages 2 1 −1 (−50.0%) 8 ✅ Baseline:
b0ee7dd· PR result:31cd548· Source CI: successScenario 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.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes