Skip to content

refactor(provider-core): follow the Effect service conventions throughout - #17427

Merged
juliusmarminge merged 2 commits into
t3/provider-model-catalogfrom
t3/provider-core-conventions
Oct 9, 2026
Merged

juliusmarminge merged 2 commits into
t3/provider-model-catalogfrom
t3/provider-core-conventions

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

The first part of a full audit of the provider packages against docs/internals/effect-services.md. This PR covers provider-core and the places that consume it.

Shape interfaces

  • IdAllocatorV2, ProviderAdapterV2, and ProviderHost now define their interface inline. Consumers use X["Service"], about 90 references across the packages and the server.
  • IdAllocatorV2's sub-records are renamed IdAllocatorV2Allocate and IdAllocatorV2Derive.

Module names and keys

  • continuationRequests becomes ProviderContinuationRequests, since it defines a Context.Reference. Its key changes to match.
  • ProviderAuthFlow becomes providerAuthFlow, since it defines no service.

Namespace imports

  • Every import from a provider-core service module is now a namespace import. That covers IdAllocator, ProviderAdapter, ProviderHost, ProviderEventLoggers, ProviderContinuationRequests, and ModelCatalog.
  • This PR only touches imports of these provider-core modules. Imports between server modules are left alone.

Services come from the environment

  • makeProviderSnapshotSettingsSource now yields ProviderHost instead of taking host.settings. Its 8 driver call sites are updated.
  • IdAllocator.derive is now a top-level pure export that the layer reuses. The failure and retry turn-item helpers use it and drop their idAllocator parameter.

No re-export shims

  • The server's ProviderEventLoggers.ts re-exported the core tag next to its own layer. The module is gone: server.ts builds the layer inline (its only consumer), and everything else imports the tag from provider-core.

Not in this PR: the per-package findings and the module-level state, such as the MCP session map, the version cache, Cursor's SDK guard and keychain singleton, and the OpenCode message-id counter. Those come next as their own layers.

Verification: typecheck is clean across provider-core, all eight provider packages, and the server. 1280 tests pass across the provider packages, provider drivers and registry, session manager, and orchestrator replay fixtures. knip and lint pass.

Done by Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code


Devin Review

@juliusmarminge
juliusmarminge added this pull request to stack #17428 October 9, 2026 07:17
@juliusmarminge
juliusmarminge marked this pull request as ready for review October 9, 2026 07:17
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 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: Not approved

Macroscope's review found this PR not approvable — This is a broad provider-core and server-wide refactor that changes shared Effect service abstractions, module/service identities, dependency acquisition, and production logger wiring across 107 files. Although the underlying logging and ID algorithms appear preserved and no product defaults or schemas change, the shared-infrastructure scope warrants human review.

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.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Codex Live turn messages — 1 — 8 ✅
Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 21.2 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: ffd407b · 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.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

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: 0bf15e23-ab97-46d8-b0cc-453194c85972

📥 Commits

Reviewing files that changed from the base of the PR and between 3c9e832 and 7e29597.


📒 Files selected for processing (107)
  • apps/server/scripts/record-claude-agent-sdk-replay-fixture.ts
  • apps/server/scripts/record-grok-acp-replay-fixture.ts
  • apps/server/src/mcp/McpToolAccess.race.test.ts
  • apps/server/src/mcp/OrchestratorMcpService.test.ts
  • apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts
  • apps/server/src/mcpApps/McpAppRequests.test.ts
  • apps/server/src/mcpApps/McpAppRequests.ts
  • apps/server/src/orchestration-v2/AcpRegistryOrchestratorV2.live.test.ts
  • apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
  • apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.testkit.ts
  • apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
  • apps/server/src/orchestration-v2/Adapters/CursorAdapterV2.testkit.ts
  • apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.testkit.ts
  • apps/server/src/orchestration-v2/Adapters/MuseAdapterV2.testkit.ts
  • apps/server/src/orchestration-v2/Adapters/OpenCode2AdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/OpenCodeAdapterV2.testkit.ts
  • apps/server/src/orchestration-v2/BackgroundWorkStop.integration.test.ts
  • apps/server/src/orchestration-v2/CheckpointCaptureService.ts
  • apps/server/src/orchestration-v2/CheckpointRollbackService.test.ts
  • apps/server/src/orchestration-v2/CheckpointRollbackService.ts
  • apps/server/src/orchestration-v2/CheckpointService.ts
  • apps/server/src/orchestration-v2/ContextHandoffBudget.test.ts
  • apps/server/src/orchestration-v2/ContextHandoffDelivery.ts
  • apps/server/src/orchestration-v2/CursorOrchestratorV2.live.test.ts
  • apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts
  • apps/server/src/orchestration-v2/DispatchModeLimit.test.ts
  • apps/server/src/orchestration-v2/GrokOrchestratorV2.live.test.ts
  • apps/server/src/orchestration-v2/OpenCode2OrchestratorV2.live.test.ts
  • apps/server/src/orchestration-v2/Orchestrator.control-reads.test.ts
  • apps/server/src/orchestration-v2/Orchestrator.ts
  • apps/server/src/orchestration-v2/ProviderAdapterRegistry.test.ts
  • apps/server/src/orchestration-v2/ProviderAdapterRegistry.ts
  • apps/server/src/orchestration-v2/ProviderContinuationService.test.ts
  • apps/server/src/orchestration-v2/ProviderContinuationService.ts
  • apps/server/src/orchestration-v2/ProviderEventIngestor.ts
  • apps/server/src/orchestration-v2/ProviderSessionManager.test.ts
  • apps/server/src/orchestration-v2/ProviderSessionManager.ts
  • apps/server/src/orchestration-v2/ProviderSwitchService.test.ts
  • apps/server/src/orchestration-v2/ProviderTurnControlService.test.ts
  • apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts
  • apps/server/src/orchestration-v2/ProviderTurnStartService.ts
  • apps/server/src/orchestration-v2/RunExecutionService.test.ts
  • apps/server/src/orchestration-v2/RunExecutionService.ts
  • apps/server/src/orchestration-v2/RuntimePolicy.ts
  • apps/server/src/orchestration-v2/RuntimeRequestService.test.ts
  • apps/server/src/orchestration-v2/SelectionRestart.integration.test.ts
  • apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts
  • apps/server/src/orchestration-v2/ThreadDeletion.ts
  • apps/server/src/orchestration-v2/ThreadFork.execution.test.ts
  • apps/server/src/orchestration-v2/ThreadLaunchService.test.ts
  • apps/server/src/orchestration-v2/ThreadStop.test.ts
  • apps/server/src/orchestration-v2/ThreadTitleRegenerationService.test.ts
  • apps/server/src/orchestration-v2/assistantStreaming.test.ts
  • apps/server/src/orchestration-v2/assistantStreaming.ts
  • apps/server/src/orchestration-v2/legacy/LegacyV1Cutover.integration.test.ts
  • apps/server/src/orchestration-v2/runtimeLayer.test.ts
  • apps/server/src/orchestration-v2/runtimeLayer.ts
  • apps/server/src/orchestration-v2/testkit/ProviderReplayHarness.ts
  • apps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts
  • apps/server/src/provider/CodexChatGptAuth.ts
  • apps/server/src/provider/Drivers/AntigravityDriver.test.ts
  • apps/server/src/provider/Drivers/AntigravityDriver.ts
  • apps/server/src/provider/Drivers/ClaudeDriver.ts
  • apps/server/src/provider/Drivers/CodexDriver.test.ts
  • apps/server/src/provider/Drivers/CodexDriver.ts
  • apps/server/src/provider/Drivers/CodexManagedProvider.ts
  • apps/server/src/provider/EventNdjsonLogger.ts
  • apps/server/src/provider/ProviderEventLoggersLive.ts
  • apps/server/src/provider/ProviderHostLive.ts
  • apps/server/src/provider/ProviderInstanceRegistry.test.ts
  • apps/server/src/provider/ProviderInstanceRegistryHydration.ts
  • apps/server/src/provider/ProviderOrchestrationAdapterInfrastructure.ts
  • apps/server/src/provider/ProviderRegistry.test.ts
  • apps/server/src/server.ts
  • packages/provider-acp-registry/src/server/auth.ts
  • packages/provider-acp-registry/src/server/driver.ts
  • packages/provider-acp/src/server/adapter.ts
  • packages/provider-core/package.json
  • packages/provider-core/src/server/IdAllocator.ts
  • packages/provider-core/src/server/ProviderAdapter.ts
  • packages/provider-core/src/server/ProviderContinuationRequests.ts
  • packages/provider-core/src/server/ProviderHost.ts
  • packages/provider-core/src/server/adapterDriver.ts
  • packages/provider-core/src/server/driver.ts
  • packages/provider-core/src/server/failure.ts
  • packages/provider-core/src/server/providerAuthFlow.test.ts
  • packages/provider-core/src/server/providerAuthFlow.ts
  • packages/provider-core/src/server/snapshotSettings.ts
  • packages/provider-cursor/src/server/adapter.ts
  • packages/provider-cursor/src/server/driver.ts
  • packages/provider-grok/src/server/adapter.ts
  • packages/provider-grok/src/server/driver.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-opencode/src/server/adapter.ts
  • packages/provider-opencode/src/server/driver.ts
  • packages/provider-opencode/src/server/v2/adapter.ts
  • packages/provider-pi/src/server/adapter.test.ts
  • packages/provider-pi/src/server/adapter.ts
  • packages/provider-pi/src/server/driver.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.



📝 Walkthrough

Walkthrough

This pull request aligns provider-core service types and package entry points across server and provider packages. It updates snapshot-settings access and failure-item ID allocation. Adapter behavior and test scenarios are otherwise unchanged.

Changes

Provider-core API alignment

Layer / File(s) Summary
Service contracts and provider-core exports
packages/provider-core/src/server/IdAllocator.ts, packages/provider-core/src/server/ProviderAdapter.ts, packages/provider-core/src/server/ProviderHost.ts, packages/provider-core/src/server/adapterDriver.ts, packages/provider-core/src/server/driver.ts, packages/provider-core/package.json
Service shapes are now declared through their service types. The ProviderAdapterV2Shape and allocator shape aliases were removed. Provider-core exports now use the ProviderContinuationRequests and lowercase providerAuthFlow entry points.
Snapshot settings and failure-item ID allocation
packages/provider-core/src/server/snapshotSettings.ts, packages/provider-core/src/server/failure.ts, apps/server/src/provider/Drivers/*, packages/provider-*/src/server/driver.ts, apps/server/src/orchestration-v2/Adapters/*
Snapshot settings are now provided by an Effect that reads settings from ProviderHost. Failure and retry turn-item helpers now derive IDs through IdAllocator and no longer accept an allocator input. Related callers were updated.
Server and provider API migration
apps/server/src/orchestration-v2/*, apps/server/src/mcp/*, apps/server/src/mcpApps/*, apps/server/src/provider/*, packages/provider-*/src/server/*, apps/server/scripts/*
Provider adapter, allocator, event-logger, host, and continuation-request references now use the provider-core namespaces and service types. Tests and recording scripts use the updated references; their scenarios and assertions remain unchanged.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor


Merge Risk: ⚪ Minimal · up to 7e295

No concrete issue remains that would prevent merging after normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check Warning The description explains the changes, out-of-scope work, verification results, and agent usage. It does not provide the required Problem and Scope and approval sections, and it does not include an iss… Add the required Problem, Change, Scope and approval, and Verification headings. Describe the underlying problem and expected behavior. Provide the triaged issue or explicit maintainer approval with its approval comment, or explain why this…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the provider-core refactor and follows conventional commit style.

Full details: Description check

Explanation

The description explains the changes, out-of-scope work, verification results, and agent usage. It does not provide the required Problem and Scope and approval sections, and it does not include an issue link, maintainer approval, or a focused-fix exemption rationale.

Resolution

Add the required Problem, Change, Scope and approval, and Verification headings. Describe the underlying problem and expected behavior. Provide the triaged issue or explicit maintainer approval with its approval comment, or explain why this focused change qualifies for an exemption.



  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

juliusmarminge and others added 2 commits October 9, 2026 09:05
…hout

An audit of every provider-core module against
docs/internals/effect-services.md:

- No standalone Shape interfaces: IdAllocatorV2, ProviderAdapterV2, and
  ProviderHost define their interface inline; consumers use
  `X["Service"]`. IdAllocatorV2's sub-records drop the Shape suffix.
- Service modules are PascalCase and utility modules camelCase:
  continuationRequests becomes ProviderContinuationRequests (with a
  matching key), and ProviderAuthFlow becomes providerAuthFlow (it
  defines no service).
- Imports from service modules (IdAllocator, ProviderAdapter,
  ProviderHost, ProviderEventLoggers, ProviderContinuationRequests,
  ModelCatalog) are namespace imports everywhere they are used.
- Services come from the environment, not parameters:
  makeProviderSnapshotSettingsSource yields ProviderHost, and the
  failure turn-item helpers use the pure IdAllocator.derive, now a
  top-level export the layer reuses.
- No re-export shims: the server's ProviderEventLoggers module becomes
  ProviderEventLoggersLive (its layer only), and consumers import the
  tag from provider-core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rver.ts

Its only consumer was the runtime layer; a separate *Live module for 25 lines
added an import path and nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the t3/provider-core-conventions branch from 7e29597 to ffd407b Compare October 9, 2026 16:07
@juliusmarminge
juliusmarminge merged commit b66dd40 into main Oct 9, 2026
29 of 31 checks passed
@juliusmarminge
juliusmarminge deleted the t3/provider-core-conventions branch October 9, 2026 16:15
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:XL 500-999 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