Skip to content

Add Claude Code provider integration#600

Closed
sasha-s wants to merge 2 commits intopingdotgg:mainfrom
sasha-s:t3code/claude-code-integration-track
Closed

Add Claude Code provider integration#600
sasha-s wants to merge 2 commits intopingdotgg:mainfrom
sasha-s:t3code/claude-code-integration-track

Conversation

@sasha-s
Copy link

@sasha-s sasha-s commented Mar 9, 2026

Summary

  • add first-class Claude Code provider support across contracts, server runtime, and web UI
  • wire provider-specific startup options and Claude auth/config guidance through the current architecture
  • fix Claude startup/runtime issues found during live testing (startup deadlock, swallowed turn-start failures, assistant stream dedupe)

What changed

  • add claudeCode provider capabilities, model catalog, provider options schema, and provider-aware effort handling
  • add SDK-backed ClaudeCodeAdapter and register it in the provider stack
  • extend provider health/status and surface capability/auth info to the web app
  • enable Claude in the provider picker, settings, custom model management, and provider-specific traits UI
  • thread providerOptions through orchestration command flow
  • add branch-local dev launcher and shared clipboard/auth-guidance helpers
  • add web UUID fallback when crypto.randomUUID() is unavailable

Validation

  • bun lint
  • bun typecheck
  • targeted tests:
    • bun x vitest run apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
    • bun x vitest run apps/web/src/lib/utils.test.ts
    • bun x vitest run apps/web/src/providerAuthGuidance.test.ts
    • bun x vitest run packages/contracts/src/provider.test.ts packages/contracts/src/orchestration.test.ts packages/shared/src/model.test.ts apps/web/src/appSettings.test.ts apps/web/src/components/ChatView.providerOptions.test.ts

Note

Add Claude Code provider and wire end‑to‑end capabilities, session adapter, health checks, and web UI routing across contracts, server, and chat surfaces

Introduce claudeCode as a first‑class provider: add contracts for provider kinds, capabilities, model options, and start options; implement a ClaudeCode adapter and register it in the provider registry and health service; update web chat to infer/select providers, gate features by capabilities, and pass provider‑scoped options; extend settings to configure Claude paths and custom models; and adjust shared host/dev tooling for remote development.

📍Where to Start

Start with provider contracts to see the new provider surface in packages/contracts/src/provider.ts (capabilities map) and packages/contracts/src/providerOptions.ts (start options), then review the server adapter registration in apps/server/src/provider/Layers/ProviderAdapterRegistry.ts and the Claude adapter in apps/server/src/provider/Layers/ClaudeCodeAdapter.ts. Finally, follow the web selection/dispatch path beginning at apps/web/src/components/ChatView.tsx.

Macroscope summarized 902e78b.

@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e64067b0-466f-4f4f-a623-e80b00788223

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

INSTALL_DIR="$ROOT_DIR/.local/node-${DIST_VERSION}-${OS}-${ARCH}"
SYMLINK_PATH="$ROOT_DIR/.local/node"
ARCHIVE_PATH="$DOWNLOAD_DIR/$FILE"
SHASUMS_PATH="$DOWNLOAD_DIR/SHASUMS256.txt"
Copy link
Contributor

Choose a reason for hiding this comment

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

🟢 Low scripts/install-local-node.sh:27

The script caches SHASUMS256.txt without versioning, so switching Node.js versions causes checksum verification to fail. When .node-version changes, the old SHASUMS file is reused but doesn't contain the new archive's hash, causing grep at line 40 to return empty and sha256sum -c to fail with a confusing error. Consider including ${DIST_VERSION} in the SHASUMS filename to version the cache, or always re-download it.

+SHASUMS_PATH="$DOWNLOAD_DIR/SHASUMS256-${DIST_VERSION}.txt"
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file scripts/install-local-node.sh around line 27:

The script caches `SHASUMS256.txt` without versioning, so switching Node.js versions causes checksum verification to fail. When `.node-version` changes, the old SHASUMS file is reused but doesn't contain the new archive's hash, causing `grep` at line 40 to return empty and `sha256sum -c` to fail with a confusing error. Consider including `${DIST_VERSION}` in the SHASUMS filename to version the cache, or always re-download it.

Comment on lines +35 to +40
claudeBinaryPath: Schema.String.check(Schema.isMaxLength(4096)).pipe(
Schema.withConstructorDefault(() => Option.some("")),
),
claudeHomePath: Schema.String.check(Schema.isMaxLength(4096)).pipe(
Schema.withConstructorDefault(() => Option.some("")),
),
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 Medium src/appSettings.ts:35

Adding required claudeBinaryPath, claudeHomePath, and customClaudeCodeModels fields to AppSettingsSchema causes Schema.decodeSync to throw when parsing legacy settings from localStorage that lack these keys. The caught error triggers DEFAULT_APP_SETTINGS, permanently overwriting the user's existing configuration on the next save. Consider marking new fields as optional with decoding defaults (e.g., Schema.optionalWith({ default: ... }) or Schema.withDecodingDefault) so legacy data decodes without throwing.

-  claudeBinaryPath: Schema.String.check(Schema.isMaxLength(4096)).pipe(
-    Schema.withConstructorDefault(() => Option.some("")),
-  ),
-  claudeHomePath: Schema.String.check(Schema.isMaxLength(4096)).pipe(
-    Schema.withConstructorDefault(() => Option.some("")),
-  ),
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/web/src/appSettings.ts around lines 35-40:

Adding required `claudeBinaryPath`, `claudeHomePath`, and `customClaudeCodeModels` fields to `AppSettingsSchema` causes `Schema.decodeSync` to throw when parsing legacy settings from `localStorage` that lack these keys. The caught error triggers `DEFAULT_APP_SETTINGS`, permanently overwriting the user's existing configuration on the next save. Consider marking new fields as optional with decoding defaults (e.g., `Schema.optionalWith({ default: ... })` or `Schema.withDecodingDefault`) so legacy data decodes without throwing.

Evidence trail:
- apps/web/src/appSettings.ts (full file showing schema definition using withConstructorDefault and parsePersistedSettings function)
- git_diff MERGE_BASE..REVIEWED_COMMIT apps/web/src/appSettings.ts (shows claudeBinaryPath, claudeHomePath, customClaudeCodeModels added with withConstructorDefault)
- git_grep 'withDecodingDefault' (confirms withDecodingDefault exists and is used in packages/contracts/src/orchestration.ts and packages/contracts/src/terminal.ts, proving both functions exist with different purposes)
- package.json (shows effect dependency from effect-smol)

@binbandit
Copy link
Contributor

How is this PR better / different from the pre-existing one? #179

@sasha-s sasha-s force-pushed the t3code/claude-code-integration-track branch from 07edcf8 to 902e78b Compare March 9, 2026 02:43
@sasha-s sasha-s force-pushed the t3code/claude-code-integration-track branch from 902e78b to 34dc87d Compare March 9, 2026 02:43
@sasha-s
Copy link
Author

sasha-s commented Mar 9, 2026

How is this PR better / different from the pre-existing one? #179

$179 was an earlier Claude adapter on an older architecture. This PR is built for the current main provider/orchestration stack, adds provider-aware Claude config + effort handling, and includes live-debugged runtime fixes for startup, error surfacing, timeout diagnostics, and streamed assistant message stability.

In short: it works and it is what i use :)

@t3dotgg
Copy link
Member

t3dotgg commented Mar 9, 2026

Did you ignore the contribution instructions entirely? lol. Nobody's reviewing 4k lines of your slop.

@t3dotgg t3dotgg closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants