Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(provider): bring opencode, muse, pi, core and testing in line with Effect conventions #17542

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

juliusmarmingecommented

Part of the provider-package audit: every module in provider-opencode, -muse, -pi, -core and -testing should now follow docs/internals/effect-services.md.

Shape interfaces and naming

  • OpenCodeRuntimeShape is inlined into the service. Consumers use OpenCodeRuntime.OpenCodeRuntime["Service"].
  • ServerProviderShape wasn't a service at all. It's renamed ManagedServerProvider, next to makeManagedServerProvider.
  • provider-testing/host.ts defined a service in a camelCase module. It's now TestProviderHost.ts, exporting layer and TestProviderHostSettings, and its key matches the module.

State and services

  • OpenCode's message-id counter was a pair of module-level lets. It's now a Ref owned by the adapter. Ordering only matters within one session, and one adapter owns each session. Uniqueness across adapters comes from the random suffix, as before.
  • OpenCode2Client.readEvents and OpenCode v2 text generation yield HttpClient and ProviderHost instead of taking them as parameters.
  • expandHomePathWith(value, path) took a service as a parameter and gave the same result as expandHomePath on Node. It's removed.

Imports

  • effect/http, effect/process and effect/testing modules are imported as subpath namespaces in 34 files.

Left as is, deliberately

  • managedProvider's refresh still uses orDie. The only typed error is a settings-read failure that no caller can recover from.
  • OpenCodeRuntimeError still builds detail from cause.message (47 constructions, user-visible). That's a separate PR.
  • The Muse SDK host stays a test-seam option. It doesn't depend on any Effect service.

Model: Claude Opus 5.5 via Claude Code in T3 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 6bc94e1

      Macroscope's review found this PR approvable — This is a broad but largely mechanical refactor to align private provider packages with Effect conventions. The limited production-path changes preserve existing path, HTTP, host, and provider behavior while making state ownership explicit, with no new capability, schema change, product-default change, deployment change, or static-analysis suppression.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

      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 messages12+1 (+100.0%)8✅

      Baseline: a669827 · PR result: 6bc94e1 · 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.

    5. juliusmarminge merged this31b04e2

    6. juliusmarminge closed this

Sign in to join this conversation.