refactor(provider): bring opencode, muse, pi, core and testing in line with Effect conventions #17542
main fromrefs/pull/17542/head·merged by juliusmarminge View on GitHubPart 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
OpenCodeRuntimeShapeis inlined into the service. Consumers useOpenCodeRuntime.OpenCodeRuntime["Service"].ServerProviderShapewasn't a service at all. It's renamedManagedServerProvider, next tomakeManagedServerProvider.provider-testing/host.tsdefined a service in a camelCase module. It's nowTestProviderHost.ts, exportinglayerandTestProviderHostSettings, and its key matches the module.
State and services
- OpenCode's message-id counter was a pair of module-level
lets. It's now aRefowned 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.readEventsand OpenCode v2 text generation yieldHttpClientandProviderHostinstead of taking them as parameters.expandHomePathWith(value, path)took a service as a parameter and gave the same result asexpandHomePathon Node. It's removed.
Imports
effect/http,effect/processandeffect/testingmodules are imported as subpath namespaces in 34 files.
Left as is, deliberately
managedProvider'srefreshstill usesorDie. The only typed error is a settings-read failure that no caller can recover from.OpenCodeRuntimeErrorstill buildsdetailfromcause.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
- 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
Approvability#
Verdict: Approved at
6bc94e1Macroscope'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).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
mainmeasurement shown below.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 1 2 +1 (+100.0%) 8 ✅ Baseline:
a669827· PR result:6bc94e1· 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.
juliusmarminge merged this31b04e2
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes