Add Claude Code provider integration#600
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| 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" |
There was a problem hiding this comment.
🟢 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.
| claudeBinaryPath: Schema.String.check(Schema.isMaxLength(4096)).pipe( | ||
| Schema.withConstructorDefault(() => Option.some("")), | ||
| ), | ||
| claudeHomePath: Schema.String.check(Schema.isMaxLength(4096)).pipe( | ||
| Schema.withConstructorDefault(() => Option.some("")), | ||
| ), |
There was a problem hiding this comment.
🟡 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)
|
How is this PR better / different from the pre-existing one? #179 |
07edcf8 to
902e78b
Compare
902e78b to
34dc87d
Compare
$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 :) |
|
Did you ignore the contribution instructions entirely? lol. Nobody's reviewing 4k lines of your slop. |
Summary
What changed
claudeCodeprovider capabilities, model catalog, provider options schema, and provider-aware effort handlingClaudeCodeAdapterand register it in the provider stackproviderOptionsthrough orchestration command flowcrypto.randomUUID()is unavailableValidation
bun lintbun typecheckbun x vitest run apps/server/src/orchestration/Layers/ProviderCommandReactor.test.tsbun x vitest run apps/web/src/lib/utils.test.tsbun x vitest run apps/web/src/providerAuthGuidance.test.tsbun 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.tsNote
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
claudeCodeas a first‑class provider: add contracts for provider kinds, capabilities, model options, and start options; implement aClaudeCodeadapter 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) andpackages/contracts/src/providerOptions.ts(start options), then review the server adapter registration inapps/server/src/provider/Layers/ProviderAdapterRegistry.tsand the Claude adapter inapps/server/src/provider/Layers/ClaudeCodeAdapter.ts. Finally, follow the web selection/dispatch path beginning atapps/web/src/components/ChatView.tsx.Macroscope summarized 902e78b.