refactor(provider-muse): move Muse Code into its own provider package #17331
main fromrefs/pull/17331/head·merged by juliusmarminge View on GitHubMuse Code moves into @t3tools/provider-muse, following the same package layout as Pi (#17302):
./settings: the instance settings schema, moved out of contracts../client: label, Beta badge, settings form, and a plain-data icon. Web and mobile now draw it from the package, replacing their hand-drawn Muse icons../server: the driver and adapter factory the server registers../testing: MSP launch helpers for the replay testkit and fixture recorder, which stay in the server because they build on the orchestrator replay harness.
The Muse adapter and driver reach the server only through ProviderHost (cwd and attachment paths). Muse text generation uses provider-core's ProviderTextGeneration type. The shared fakeCli test helper moves to @t3tools/provider-testing.
Not checked in a running client: the Muse icon uses the same neutral light/dark colors mobile already used. On web it previously inherited the surrounding text color.
Stack: #17330 → #17331 → #17345 → #17349 → #17354 → #17357.
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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
juliusmarminge added labelsmacroscope-review
- @@ -207,4 +203,4 @@207203 readonly settings: MuseSettings;208204 readonly environment: NodeJS.ProcessEnv;209205 readonly idAllocator: IdAllocator.IdAllocatorV2["Service"];210- readonly serverConfig: ServerConfig.ServerConfig["Service"];206+ readonly host: ProviderHostShape;
Posted via Macroscope — Effect Service ConventionsProviderHostis an Effect service dependency, but the adapter factory now accepts its service shape as an option. Could you acquire it from the Effect environment during construction (yield* ProviderHost.ProviderHost) and expose that requirement in the factory's Effect type, rather than passinghostfrom the driver? This keeps production service dependencies in the environment. 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:
adb31633-ca08-4fe7-a36d-ee3591089066
📥 Commits
Reviewing files that changed from the base of the PR and between 574fbd0b65b00f72399b4271224f22b5bc746659 and 54e172956250c0456cbb6850426e80e966b1fc49.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (43)
apps/mobile/package.jsonapps/mobile/src/components/ProviderIcon.tsxapps/mobile/src/lib/providerClients.tsapps/server/package.jsonapps/server/scripts/record-muse-msp-replay-fixture.tsapps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.tsapps/server/src/provider/GrokProvider.test.tsapps/server/src/provider/builtInDrivers.tsapps/server/src/textGeneration/ClaudeTextGeneration.test.tsapps/server/src/textGeneration/CodexTextGeneration.test.tsapps/server/src/textGeneration/GrokTextGeneration.test.tsapps/web/package.jsonapps/web/src/components/Icons.tsxapps/web/src/components/chat/ProviderInstanceIcon.tsxapps/web/src/components/settings/providerDriverMeta.tspackage.jsonpackages/contracts/src/settings.tspackages/provider-muse/package.jsonpackages/provider-muse/src/client.tspackages/provider-muse/src/server.tspackages/provider-muse/src/server/adapter.test.tspackages/provider-muse/src/server/adapter.tspackages/provider-muse/src/server/driver.tspackages/provider-muse/src/server/itemPresentation.test.tspackages/provider-muse/src/server/itemPresentation.tspackages/provider-muse/src/server/maintenance.test.tspackages/provider-muse/src/server/maintenance.tspackages/provider-muse/src/server/modelCatalog.test.tspackages/provider-muse/src/server/modelCatalog.tspackages/provider-muse/src/server/protocol.test.tspackages/provider-muse/src/server/protocol.tspackages/provider-muse/src/server/sdk.test.tspackages/provider-muse/src/server/sdk.tspackages/provider-muse/src/server/status.test.tspackages/provider-muse/src/server/status.tspackages/provider-muse/src/server/textGeneration.test.tspackages/provider-muse/src/server/textGeneration.tspackages/provider-muse/src/settings.tspackages/provider-muse/src/testing.tspackages/provider-muse/tsconfig.jsonpackages/provider-testing/package.jsonpackages/provider-testing/src/fakeCli.tsscripts/release-smoke.ts
💤 Files with no reviewable changes (4)
- apps/web/src/components/Icons.tsx
- apps/mobile/src/components/ProviderIcon.tsx
- packages/contracts/src/settings.ts
- apps/web/src/components/chat/ProviderInstanceIcon.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
📝 Walkthrough
Walkthrough#
Muse settings, client metadata, and server implementation move into the
@t3tools/provider-musepackage. Mobile, web, and server consumers use its package entry points. The adapter usesProviderHostfor working-directory and attachment access.Changes#
Muse provider package extraction
Layer / File(s) Summary Package settings and entry points
packages/contracts/src/settings.ts,packages/provider-muse/*,package.json,scripts/release-smoke.tsThe package defines the Muse settings schema and client metadata, and exposes server and testing entry points. Package configuration, workspace analysis, and release smoke fixture include the new package. Server implementation and ProviderHost integration
apps/server/*,packages/provider-muse/src/server/*,packages/provider-testing/package.jsonThe Muse driver and adapter use package-local modules and ProviderHostfor working-directory and attachment access. Server registration and replay fixtures use the package exports. Adapter and provider tests update their dependencies and imports; shared fake-CLI utilities gain a package export used by server and provider tests.Mobile and web provider registration
apps/mobile/*,apps/web/*Mobile and web register museClient. Their Muse-specific icon branches are removed, leaving the existing package-icon lookup and fallback behavior.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Suggested reviewers:
t3dotggMerge Risk: ⚪ Minimal · up to
54e17No actionable merge-blocking issue was identified; the changed attachment and icon paths retain their intended behavior.
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)#
Check name Status Explanation Resolution Description check The description explains the package split and affected components, but it omits the required Problem, Change, Scope and approval, and Verification sections. It provides no issue or approval link and … Structure the description with the required headings. Add the problem and expected behavior, explain the change, link the triaged issue or maintainer approval, and document focused tests or manual checks with observed results. Keep the note… ✅ Passed checks (3 passed)
Check name Status Explanation 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. Title check The title clearly and concisely describes the main change: moving Muse Code into its own provider package. Full details: Description check
Explanation
The description explains the package split and affected components, but it omits the required Problem, Change, Scope and approval, and Verification sections. It provides no issue or approval link and no focused test results.
Resolution
Structure the description with the required headings. Add the problem and expected behavior, explain the change, link the triaged issue or maintainer approval, and document focused tests or manual checks with observed results. Keep the note about the client not being checked in a running environment.
- Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- Commit to this branch
- Create a new PR
📝 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.macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved at
3aa0aa4Macroscope's review found this PR approvable — This is primarily a mechanical extraction of the existing Muse provider into its own package, with tests and server/client wiring moved alongside it. Runtime differences are limited to data-driven icon registration and equivalent ProviderHost access; settings defaults and production behavior remain otherwise unchanged.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
No code changes detected at
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).d4662a2. Prior analysis still applies.juliusmarminge merged this5b78b34
juliusmarminge closed this
Sign in to join this conversation.
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
e38b6a1· PR result:d4662a2· 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.