Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(provider-muse): move Muse Code into its own provider package #17331

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

juliusmarmingecommented

Muse 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


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

    2. juliusmarminge added labelsmacroscope-review

    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      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 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: e38b6a1 · PR result: d4662a2 · 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.

    4. @@ -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;
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      ProviderHost is 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 passing host from the driver? This keeps production service dependencies in the environment.

      Posted via Macroscope — Effect Service Conventions
    5. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      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: 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.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (43)
      • apps/mobile/package.json
      • apps/mobile/src/components/ProviderIcon.tsx
      • apps/mobile/src/lib/providerClients.ts
      • apps/server/package.json
      • apps/server/scripts/record-muse-msp-replay-fixture.ts
      • apps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.ts
      • apps/server/src/provider/GrokProvider.test.ts
      • apps/server/src/provider/builtInDrivers.ts
      • apps/server/src/textGeneration/ClaudeTextGeneration.test.ts
      • apps/server/src/textGeneration/CodexTextGeneration.test.ts
      • apps/server/src/textGeneration/GrokTextGeneration.test.ts
      • apps/web/package.json
      • apps/web/src/components/Icons.tsx
      • apps/web/src/components/chat/ProviderInstanceIcon.tsx
      • apps/web/src/components/settings/providerDriverMeta.ts
      • package.json
      • packages/contracts/src/settings.ts
      • packages/provider-muse/package.json
      • packages/provider-muse/src/client.ts
      • packages/provider-muse/src/server.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-muse/src/server/itemPresentation.test.ts
      • packages/provider-muse/src/server/itemPresentation.ts
      • packages/provider-muse/src/server/maintenance.test.ts
      • packages/provider-muse/src/server/maintenance.ts
      • packages/provider-muse/src/server/modelCatalog.test.ts
      • packages/provider-muse/src/server/modelCatalog.ts
      • packages/provider-muse/src/server/protocol.test.ts
      • packages/provider-muse/src/server/protocol.ts
      • packages/provider-muse/src/server/sdk.test.ts
      • packages/provider-muse/src/server/sdk.ts
      • packages/provider-muse/src/server/status.test.ts
      • packages/provider-muse/src/server/status.ts
      • packages/provider-muse/src/server/textGeneration.test.ts
      • packages/provider-muse/src/server/textGeneration.ts
      • packages/provider-muse/src/settings.ts
      • packages/provider-muse/src/testing.ts
      • packages/provider-muse/tsconfig.json
      • packages/provider-testing/package.json
      • packages/provider-testing/src/fakeCli.ts
      • scripts/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-muse package. Mobile, web, and server consumers use its package entry points. The adapter uses ProviderHost for 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.ts
      The 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.json
      The Muse driver and adapter use package-local modules and ProviderHost for 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: t3dotgg

      Merge Risk: ⚪ Minimal · up to 54e17

      No 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 nameStatusExplanationResolution
      Description checkWarningThe 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 nameStatusExplanation
      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.
      Title checkPassedThe 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.
    6. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 3aa0aa4

      Macroscope'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 d4662a2. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    7. juliusmarminge merged this5b78b34

    8. juliusmarminge closed this

Sign in to join this conversation.