Skip to content

fix(provider): make Claude SDK opt-in - #2

Merged
onmax merged 7 commits into
mainfrom
fix/lazy-claude-sdk-import
Aug 28, 2026
Merged

fix(provider): make Claude SDK opt-in#2
onmax merged 7 commits into
mainfrom
fix/lazy-claude-sdk-import

Conversation

@onmax

@onmax onmax commented Aug 24, 2026

Copy link
Copy Markdown

@t3tools/provider-runtime currently installs and evaluates the Claude Agent SDK for every embedded consumer. That also lets the SDK install a platform binary of roughly 324 MB, even when the consumer uses Codex only.

This change loads the SDK only when Claude starts and keeps it as a development-only dependency of the embedded package. Consumers install it explicitly when they select Claude. Cancellation during the deferred import closes a late runtime without starting a query. An optional peer is deliberately avoided because pnpm auto-installs it.

Before / after

Before After
Importing the provider runtime evaluates the Claude SDK. Importing the provider runtime does not resolve the SDK.
Codex-only consumers install the Claude SDK and its optional native package. A packed consumer installs and imports without the Claude SDK present.
Interrupting startup can race a delayed import. An interrupted import cannot start a Claude query.

The corresponding source change is also proposed upstream in pingdotgg/t3code#8104. This fork PR adds the package contract needed by the separately published @t3tools/provider-runtime package.

Verification

  • focused Claude adapter and provider tests: 75 passed
  • provider-runtime tests: 1 passed
  • provider-runtime build passed
  • packed consumer installed and imported without @anthropic-ai/claude-agent-sdk
  • packed output retains a deferred SDK import

The provider-runtime typecheck still reports the existing contracts mismatch around mcp_elicitation_approval; this branch does not change that contract.

Created with the Codex harness using gpt-5.6-sol.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Aug 24, 2026
@onmax onmax closed this Aug 24, 2026
@onmax onmax reopened this Aug 26, 2026
@onmax onmax changed the title fix(provider): load Claude SDK only when needed fix(provider): make Claude SDK opt-in Aug 26, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/vite-hub/t3code/@t3tools/contracts@2
pnpm add https://pkg.pr.new/vite-hub/t3code/@t3tools/provider-runtime@2

commit: 1248f5d

@onmax

onmax commented Aug 27, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05da57b9b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/provider/Drivers/ClaudeSdk.ts
@onmax

onmax commented Aug 27, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 1248f5ddb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions github-actions Bot added size:L and removed size:M labels Aug 27, 2026
@onmax
onmax marked this pull request as ready for review August 28, 2026 09:46
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@onmax
onmax merged commit 76d2937 into main Aug 28, 2026
14 of 23 checks passed
@onmax
onmax deleted the fix/lazy-claude-sdk-import branch August 28, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 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