Skip to content

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

Merged
juliusmarminge merged 1 commit into
mainfrom
t3/audit-opencode-muse-pi-core
Oct 9, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
t3/audit-opencode-muse-pi-core

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

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

…e with Effect conventions

- Inline OpenCodeRuntimeShape into the OpenCodeRuntime service; consumers use
  OpenCodeRuntime.OpenCodeRuntime["Service"].
- Move OpenCode message-id clock state from module-level lets into a Ref owned
  by makeOpenCodeAdapterV2.
- OpenCode2Client.readEvents and OpenCode 2 text generation yield their
  services instead of taking them as parameters.
- Rename provider-core ServerProviderShape to ManagedServerProvider.
- Drop expandHomePathWith; expandHomePath covers every caller.
- Rename provider-testing/host to TestProviderHost (layer +
  TestProviderHostSettings) with a matching service key.
- Import effect/http and effect/process modules as subpath namespaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 9, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 9, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

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.

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: 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.

@juliusmarminge
juliusmarminge merged commit 31b04e2 into main Oct 9, 2026
32 of 34 checks passed
@juliusmarminge
juliusmarminge deleted the t3/audit-opencode-muse-pi-core branch October 9, 2026 16:42
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 9, 2026
## What's Changed
* fix(web): Local environment switch stays reachable after turning it off by @ScottN-PV in pingdotgg/t3code#17359
* fix(web): keep chat banners inside the lane beside the docked details card by @macodev00 in pingdotgg/t3code#17094
* fix(web): settled and snoozed lines line up with the messages above them by @RakshithBhat03 in pingdotgg/t3code#17191
* fix(web): distinguish project filter from new project by @voltcrash in pingdotgg/t3code#12113
* feat(web): assign a thread details panel shortcut by @maria-rcks in pingdotgg/t3code#16694
* fix(web): chat content keeps pace with sidebar resizing by @flamboh in pingdotgg/t3code#17383
* refactor(provider-core): expose model metadata through a ModelCatalog port by @juliusmarminge in pingdotgg/t3code#17417
* refactor(provider-core): follow the Effect service conventions throughout by @juliusmarminge in pingdotgg/t3code#17427
* refactor(provider-core): latest-version lookups go through a ProviderLatestVersions service by @juliusmarminge in pingdotgg/t3code#17434
* refactor(provider-core): MCP provider sessions live in a McpProviderSessions service by @juliusmarminge in pingdotgg/t3code#17446
* refactor(provider): bring opencode, muse, pi, core and testing in line with Effect conventions by @juliusmarminge in pingdotgg/t3code#17542
* refactor(provider-acp): ACP, ACP Registry and Grok follow the Effect service conventions by @juliusmarminge in pingdotgg/t3code#17544
* refactor(provider-cursor): follow the Effect service conventions by @juliusmarminge in pingdotgg/t3code#17545
* fix(marketing): use app wordmark in header by @voltcrash in pingdotgg/t3code#13240
* fix(web): pr merge actions stay visible while the stack refreshes by @maria-rcks in pingdotgg/t3code#17559

## New Contributors
* @voltcrash made their first contribution in pingdotgg/t3code#12113

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261009.2873...v0.0.46-nightly.20261009.2886

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261009.2886
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 9, 2026
## What's Changed
* fix(web): Local environment switch stays reachable after turning it off by @ScottN-PV in pingdotgg/t3code#17359
* fix(web): keep chat banners inside the lane beside the docked details card by @macodev00 in pingdotgg/t3code#17094
* fix(web): settled and snoozed lines line up with the messages above them by @RakshithBhat03 in pingdotgg/t3code#17191
* fix(web): distinguish project filter from new project by @voltcrash in pingdotgg/t3code#12113
* feat(web): assign a thread details panel shortcut by @maria-rcks in pingdotgg/t3code#16694
* fix(web): chat content keeps pace with sidebar resizing by @flamboh in pingdotgg/t3code#17383
* refactor(provider-core): expose model metadata through a ModelCatalog port by @juliusmarminge in pingdotgg/t3code#17417
* refactor(provider-core): follow the Effect service conventions throughout by @juliusmarminge in pingdotgg/t3code#17427
* refactor(provider-core): latest-version lookups go through a ProviderLatestVersions service by @juliusmarminge in pingdotgg/t3code#17434
* refactor(provider-core): MCP provider sessions live in a McpProviderSessions service by @juliusmarminge in pingdotgg/t3code#17446
* refactor(provider): bring opencode, muse, pi, core and testing in line with Effect conventions by @juliusmarminge in pingdotgg/t3code#17542
* refactor(provider-acp): ACP, ACP Registry and Grok follow the Effect service conventions by @juliusmarminge in pingdotgg/t3code#17544
* refactor(provider-cursor): follow the Effect service conventions by @juliusmarminge in pingdotgg/t3code#17545
* fix(marketing): use app wordmark in header by @voltcrash in pingdotgg/t3code#13240
* fix(web): pr merge actions stay visible while the stack refreshes by @maria-rcks in pingdotgg/t3code#17559

## New Contributors
* @voltcrash made their first contribution in pingdotgg/t3code#12113

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261009.2873...v0.0.46-nightly.20261009.2886

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261009.2886
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant