Skip to content

fix(claude): preserve skills for Vertex workspaces - #2439

Merged
bmahabirbu merged 1 commit into
openkaiden:mainfrom
bmahabirbu:fix/claude-vertex-skills
Jul 14, 2026
Merged

bmahabirbu merged 1 commit into
openkaiden:mainfrom
bmahabirbu:fix/claude-vertex-skills

Conversation

@bmahabirbu

@bmahabirbu bmahabirbu commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop setting CLAUDE_CODE_SIMPLE for Claude Vertex workspaces because it prevents Claude Code from indexing user-installed skills
  • filter any stale CLAUDE_CODE_SIMPLE entry while preserving the Vertex inference env vars
  • update Claude extension tests for the new env behavior

Fixes: #2441

Validation

  • pnpm exec vitest run extensions/claude/src/claude-extension.spec.ts

@bmahabirbu
bmahabirbu requested a review from a team as a code owner July 12, 2026 06:27
@bmahabirbu
bmahabirbu requested review from benoitf and gastoner and removed request for a team July 12, 2026 06:27
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: caba0310-6c34-4ea1-a8b3-a080f9fe3d92

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc806d and 17b4a44.

📒 Files selected for processing (2)
  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: Linux
  • GitHub Check: smoke-e2e-tests (dev) / ubuntu-24.04 (ollama)
  • GitHub Check: linter, formatters
  • GitHub Check: unit tests / windows-2022
  • GitHub Check: unit tests / macos-15
  • GitHub Check: macOS
  • GitHub Check: Windows
  • GitHub Check: typecheck
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use /@/ path aliases instead of relative paths for imports outside the current directory's module group; use relative imports only for sibling modules within the same directory

Files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
**/*.spec.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.spec.{ts,tsx,js,jsx}: Use test() instead of it() for test cases in Vitest unit tests
Use vi.mock(import('...')) for auto-mocking modules in unit tests; avoid manual mock factories when possible
Use vi.resetAllMocks() in beforeEach hooks instead of vi.clearAllMocks() for resetting mocks between tests
When an auto-mocked function or class method needs a real implementation, use vi.mocked(...) with the prototype pattern for class methods: vi.mocked(MyClass.prototype.myMethod).mockImplementation(...)

Files:

  • extensions/claude/src/claude-extension.spec.ts
extensions/*/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Register inference, container, and Kubernetes providers through the ProviderRegistry via extension APIs

Files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
🧠 Learnings (5)
📚 Learning: 2026-05-05T17:30:20.418Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/vertex-ai.ts:272-302
Timestamp: 2026-05-05T17:30:20.418Z
Learning: In the openkaiden/kaiden repo, for cloud inference provider extension code under `extensions/*/src/*.ts`, treat `ProviderConnectionStatus = 'unknown'` as a valid/expected value when registering provider connections (e.g., Gemini/Claude/Mistral/OpenAI-compatible/Vertex AI). `'unknown'` indicates the connection was set up but is not continuously monitored—so do not flag it as incorrect. Only Ollama is expected to use `'started'` because it actively polls a local server.

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📚 Learning: 2026-05-05T17:44:50.991Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/vertex-ai.ts:363-387
Timestamp: 2026-05-05T17:44:50.991Z
Learning: In this repo (openkaiden/kaiden), do not raise a code review issue when an extension’s `InferenceProviderConnectionFactory.create` factory method implementation omits (or does not use) the optional `logger` and/or `CancellationToken` parameters in its method signature/implementation. Current extensions (e.g., Vertex AI, Gemini, Claude, Mistral, OpenAI-compatible) follow this pattern, so reviewers should treat it as acceptable for `extensions/*` TypeScript source files.

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📚 Learning: 2026-05-12T10:01:14.248Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1810
File: extensions/kdn/src/kdn-extension.ts:43-46
Timestamp: 2026-05-12T10:01:14.248Z
Learning: In this repo’s extension code, when logging from binary discovery/resolution logic (e.g., choosing/validating custom paths, extension storage locations, or bundled resource paths), it’s intentional to include full filesystem paths in `console.log`/`console.warn` (such as in `extensions/**/src/*-extension.ts`). During review, do not flag these specific full-path messages as a privacy/security issue as long as they are clearly part of the binary resolution steps. If full-path logging appears outside binary discovery/resolution, review/flag it as usual.

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📚 Learning: 2026-05-12T17:14:02.153Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1850
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte:66-70
Timestamp: 2026-05-12T17:14:02.153Z
Learning: When reviewing code that uses `AgentWorkspaceSummaryUI.runtime`, treat it as a required, non-null `string` per the `openkaiden/kdn-api` 0.12.0 schema. Therefore, code like `a.runtime.localeCompare(b.runtime)` is safe and should not trigger warnings about possible `undefined`/`null` values or suggestions to use nullish coalescing/optional chaining for `runtime` (unless the current local types still mark `runtime` as optional, indicating a schema/version mismatch).

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📚 Learning: 2026-06-29T13:16:53.102Z
Learnt from: benoitf
Repo: openkaiden/kaiden PR: 2296
File: extensions/container/packages/extension/src/helper/socket-finder/_socket-finder-module.ts:28-29
Timestamp: 2026-06-29T13:16:53.102Z
Learning: When reviewing imports in openkaiden/kaiden TypeScript/JavaScript files, prefer the configured `/@/` path alias instead of relative imports that would require traversing out of the current directory/module group (i.e., paths containing `..` that cross boundaries). 

Do not require alias conversion for descendant-path relative imports within the socket-finder module directory—for example, in `extensions/container/packages/extension/src/helper/socket-finder/**`, imports like `./podman/podman-version-detector` and `./podman/podman-windows-finder` are acceptable and should not be flagged.

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
🔇 Additional comments (2)
extensions/claude/src/claude-extension.ts (1)

126-127: LGTM!

Also applies to: 141-143

extensions/claude/src/claude-extension.spec.ts (1)

401-403: LGTM!

Also applies to: 467-467


📝 Walkthrough

Walkthrough

The Vertex AI preWorkspaceStart flow no longer adds or retains CLAUDE_CODE_SIMPLE in the workspace environment. Tests verify its absence during initialization and environment replacement.

Changes

Vertex AI environment handling

Layer / File(s) Summary
Remove CLAUDE_CODE_SIMPLE from Vertex AI environments
extensions/claude/src/claude-extension.ts, extensions/claude/src/claude-extension.spec.ts
The Vertex AI startup flow stops adding and filters existing CLAUDE_CODE_SIMPLE entries, while tests verify zero matches in initialization and replacement scenarios.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • openkaiden/kaiden#2276: Updates environment-variable handling in the same Claude extension Vertex AI startup flow.

Suggested reviewers: benoitf, fbricon, gastoner

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: preserving skills in Vertex workspaces by removing CLAUDE_CODE_SIMPLE.
Description check ✅ Passed The description clearly describes the env-var fix and test update reflected in the changes.
Linked Issues check ✅ Passed The changes address #2441 by removing CLAUDE_CODE_SIMPLE so skills can be discovered while keeping Vertex env vars intact.
Out of Scope Changes check ✅ Passed The diff stays focused on Claude Vertex env handling and tests, with no obvious unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@bmahabirbu

Copy link
Copy Markdown
Contributor Author

fixes the issue where claude cant use skills

@bmahabirbu
bmahabirbu marked this pull request as draft July 12, 2026 06:33
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bmahabirbu
bmahabirbu requested a review from MarsKubeX July 13, 2026 06:46
@bmahabirbu
bmahabirbu marked this pull request as ready for review July 13, 2026 06:46
@bmahabirbu
bmahabirbu force-pushed the fix/claude-vertex-skills branch from 54e60e2 to 5cc806d Compare July 13, 2026 18:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@extensions/claude/src/claude-extension.spec.ts`:
- Line 401: Update the assertion in the relevant test to verify that no
environment entry has the name CLAUDE_CODE_SIMPLE, regardless of its value.
Match entries by the name field rather than asserting absence of the specific
name-and-value object, preserving the test’s existing intent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 02800451-320f-4356-9bf6-6e5aa1feb7aa

📥 Commits

Reviewing files that changed from the base of the PR and between 54e60e2 and 5cc806d.

📒 Files selected for processing (2)
  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: smoke-e2e-tests (dev) / ubuntu-24.04 (ollama)
  • GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
  • GitHub Check: macOS
  • GitHub Check: unit tests / macos-15
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: unit tests / windows-2022
  • GitHub Check: typecheck
  • GitHub Check: Windows
  • GitHub Check: Linux
  • GitHub Check: linter, formatters
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use /@/ path aliases instead of relative paths for imports outside the current directory's module group; use relative imports only for sibling modules within the same directory

Files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
**/*.spec.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.spec.{ts,tsx,js,jsx}: Use test() instead of it() for test cases in Vitest unit tests
Use vi.mock(import('...')) for auto-mocking modules in unit tests; avoid manual mock factories when possible
Use vi.resetAllMocks() in beforeEach hooks instead of vi.clearAllMocks() for resetting mocks between tests
When an auto-mocked function or class method needs a real implementation, use vi.mocked(...) with the prototype pattern for class methods: vi.mocked(MyClass.prototype.myMethod).mockImplementation(...)

Files:

  • extensions/claude/src/claude-extension.spec.ts
extensions/*/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Register inference, container, and Kubernetes providers through the ProviderRegistry via extension APIs

Files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
🧠 Learnings (5)
📚 Learning: 2026-05-05T17:30:20.418Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/vertex-ai.ts:272-302
Timestamp: 2026-05-05T17:30:20.418Z
Learning: In the openkaiden/kaiden repo, for cloud inference provider extension code under `extensions/*/src/*.ts`, treat `ProviderConnectionStatus = 'unknown'` as a valid/expected value when registering provider connections (e.g., Gemini/Claude/Mistral/OpenAI-compatible/Vertex AI). `'unknown'` indicates the connection was set up but is not continuously monitored—so do not flag it as incorrect. Only Ollama is expected to use `'started'` because it actively polls a local server.

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📚 Learning: 2026-05-05T17:44:50.991Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/vertex-ai.ts:363-387
Timestamp: 2026-05-05T17:44:50.991Z
Learning: In this repo (openkaiden/kaiden), do not raise a code review issue when an extension’s `InferenceProviderConnectionFactory.create` factory method implementation omits (or does not use) the optional `logger` and/or `CancellationToken` parameters in its method signature/implementation. Current extensions (e.g., Vertex AI, Gemini, Claude, Mistral, OpenAI-compatible) follow this pattern, so reviewers should treat it as acceptable for `extensions/*` TypeScript source files.

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📚 Learning: 2026-05-12T10:01:14.248Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1810
File: extensions/kdn/src/kdn-extension.ts:43-46
Timestamp: 2026-05-12T10:01:14.248Z
Learning: In this repo’s extension code, when logging from binary discovery/resolution logic (e.g., choosing/validating custom paths, extension storage locations, or bundled resource paths), it’s intentional to include full filesystem paths in `console.log`/`console.warn` (such as in `extensions/**/src/*-extension.ts`). During review, do not flag these specific full-path messages as a privacy/security issue as long as they are clearly part of the binary resolution steps. If full-path logging appears outside binary discovery/resolution, review/flag it as usual.

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📚 Learning: 2026-05-12T17:14:02.153Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1850
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte:66-70
Timestamp: 2026-05-12T17:14:02.153Z
Learning: When reviewing code that uses `AgentWorkspaceSummaryUI.runtime`, treat it as a required, non-null `string` per the `openkaiden/kdn-api` 0.12.0 schema. Therefore, code like `a.runtime.localeCompare(b.runtime)` is safe and should not trigger warnings about possible `undefined`/`null` values or suggestions to use nullish coalescing/optional chaining for `runtime` (unless the current local types still mark `runtime` as optional, indicating a schema/version mismatch).

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
📚 Learning: 2026-06-29T13:16:53.102Z
Learnt from: benoitf
Repo: openkaiden/kaiden PR: 2296
File: extensions/container/packages/extension/src/helper/socket-finder/_socket-finder-module.ts:28-29
Timestamp: 2026-06-29T13:16:53.102Z
Learning: When reviewing imports in openkaiden/kaiden TypeScript/JavaScript files, prefer the configured `/@/` path alias instead of relative imports that would require traversing out of the current directory/module group (i.e., paths containing `..` that cross boundaries). 

Do not require alias conversion for descendant-path relative imports within the socket-finder module directory—for example, in `extensions/container/packages/extension/src/helper/socket-finder/**`, imports like `./podman/podman-version-detector` and `./podman/podman-windows-finder` are acceptable and should not be flagged.

Applied to files:

  • extensions/claude/src/claude-extension.spec.ts
  • extensions/claude/src/claude-extension.ts
🔇 Additional comments (2)
extensions/claude/src/claude-extension.ts (1)

126-127: LGTM!

Also applies to: 141-143

extensions/claude/src/claude-extension.spec.ts (1)

465-465: LGTM!

Comment thread extensions/claude/src/claude-extension.spec.ts Outdated

@gastoner gastoner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codewise LGTM

Signed-off-by: Brian Mahabir <56164556+bmahabirbu@users.noreply.github.com>
@bmahabirbu
bmahabirbu force-pushed the fix/claude-vertex-skills branch from 5cc806d to 17b4a44 Compare July 14, 2026 13:27
@bmahabirbu

Copy link
Copy Markdown
Contributor Author

@CodeRabbit resolve

@bmahabirbu
bmahabirbu enabled auto-merge (squash) July 14, 2026 13:28
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved and changes approved.

@bmahabirbu
bmahabirbu merged commit e5a9650 into openkaiden:main Jul 14, 2026
31 checks passed
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.

Claude cant use Skills in sandbox (cant discover the skill)

3 participants