Skip to content

feat(openclaw): implement agent configuration for workspace preparation#2193

Open
bmahabirbu wants to merge 3 commits into
openkaiden:mainfrom
bmahabirbu:extend-openclaw
Open

feat(openclaw): implement agent configuration for workspace preparation#2193
bmahabirbu wants to merge 3 commits into
openkaiden:mainfrom
bmahabirbu:extend-openclaw

Conversation

@bmahabirbu

@bmahabirbu bmahabirbu commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the configurationFiles and preWorkspaceStart stubs with a real implementation that writes the selected model into openclaw.json at agents.defaults.model, preserving existing configuration fields.

Fixes #2175

Testing

Right now openshell doesn't have openclaw natively support so we need to use the image builder. As a workaround to test this extension one would need to start the workspace and install openclaw inside

First install openshell 0.073 or the latest version

then using kaiden create a workspace with the registered linux mcp server and make sure to give it unrestricted access

inside the openshell sandbox install openclaw via npm install --prefix /sandbox openclaw@latest

do /sandbox/node_modules/.bin/openclaw --version verify install worked (if not kaiden might not have added the priority for npm if so double check the access has npm for the default)

then do openclaw mcp status sandbox/node_modules/.bin/openclaw mcp status

follow the example below for the cli


brian@fedora:~/kaiden$ openshell sandbox list
NAME  CREATED              PHASE
AA2   2026-07-01 06:24:04  Ready
brian@fedora:~/kaiden$ openshell sandbox connect
→ Using sandbox 'AA2' (last used)
sandbox@sandbox-AA2:~$ /sandbox/node_modules/.bin/openclaw --version
bash: /sandbox/node_modules/.bin/openclaw: No such file or directory
sandbox@sandbox-AA2:~$ npm install --prefix /sandbox openclaw@latest
(node:75) [UNDICI-EHPA] Warning: EnvHttpProxyAgent is experimental, expect them to change at any time.
(Use `node --trace-warnings ...` to show where the warning was created)

added 306 packages in 1m

66 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New minor version of npm available! 11.11.0 -> 11.18.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.18.0
npm notice To update run: npm install -g npm@11.18.0
npm notice
sandbox@sandbox-AA2:~$ /sandbox/node_modules/.bin/openclaw --version
(node:160) [UNDICI-EHPA] Warning: EnvHttpProxyAgent is experimental, expect them to change at any time.
(Use `node --trace-warnings ...` to show where the warning was created)
OpenClaw 2026.6.11 (e085fa1)
sandbox@sandbox-AA2:~$ /sandbox/node_modules/.bin/openclaw mcp status
(node:168) [UNDICI-EHPA] Warning: EnvHttpProxyAgent is experimental, expect them to change at any time.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:176) [UNDICI-EHPA] Warning: EnvHttpProxyAgent is experimental, expect them to change at any time.
(Use `node --trace-warnings ...` to show where the warning was created)
│
◇  

OpenClaw 2026.6.11 (e085fa1) — The only crab in your contacts you actually want to hear from.

MCP server status (/sandbox/.openclaw/openclaw.json):
- ai.openkaiden.registry/linux: stdio
sandbox@sandbox-AA2:~$ 

🤖 Generated with Claude Code

@bmahabirbu bmahabirbu requested a review from a team as a code owner June 17, 2026 06:24
@bmahabirbu bmahabirbu requested review from benoitf and jeffmaury and removed request for a team June 17, 2026 06:24
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Openclaw extension now validates and updates openclaw.json with zod. It registers the config file, writes the workspace model label into agents.defaults.model, and translates workspace MCP servers and commands into persisted config entries.

Changes

Openclaw configuration file handling

Layer / File(s) Summary
Schema and config path
extensions/openclaw/package.json, extensions/openclaw/src/extension.ts
Adds zod as a runtime dependency, exports OPENCLAW_CONFIG_PATH, and defines zod schemas for the expected openclaw.json shape.
Agent wiring and workspace sync
extensions/openclaw/src/extension.ts
Registers the config file in configurationFiles, reads and validates the stored JSON, updates agents.defaults.model from the current workspace model label, maps workspace MCP servers and commands into config.mcp.servers, and persists the merged config.
Spec coverage for config and MCP behavior
extensions/openclaw/src/extension.spec.ts
Expands tests to assert the config-file path and cover model updates, parsing errors, absent-file no-ops, MCP mapping, merge behavior, and empty optional field handling.

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

Possibly related PRs

  • openkaiden/kaiden#2196: Adds workspace MCP exposure used by this PR’s preWorkspaceStart mapping of servers and commands.
  • openkaiden/kaiden#2237: Implements the same workspace MCP-to-config translation pattern in another extension.
  • openkaiden/kaiden#2243: Uses the same agent config update flow for model labeling and workspace MCP persistence.

Suggested reviewers: benoitf, jeffmaury, gastoner

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: implementing openclaw agent configuration during workspace preparation.
Linked Issues check ✅ Passed The code implements the requested openclaw agent configuration flow and persists the selected model into openclaw.json without overwriting existing fields.
Out of Scope Changes check ✅ Passed The added dependency, config wiring, and tests all support the agent-configuration feature and no unrelated changes are evident.
Description check ✅ Passed The description matches the changes by describing the new openclaw configuration handling and model persistence in preWorkspaceStart.

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.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
extensions/openclaw/src/extension.ts 92.59% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread extensions/openclaw/src/extension.ts Outdated
Comment on lines +52 to +65
const content = await configFile.read();
let config: Record<string, unknown>;
try {
const parsed: unknown = JSON.parse(content);
config =
typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)
? (parsed as Record<string, unknown>)
: {};
} catch {
config = {};
}

const agents = (config.agents as Record<string, unknown> | undefined) ?? {};
const defaults = (agents.defaults as Record<string, unknown> | undefined) ?? {};

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.

might use zod to have validation of the JSON as well as easing how to retrieve the values

It seems there is work in progress or a command to grab the schema from openclaw

@bmahabirbu bmahabirbu force-pushed the extend-openclaw branch 2 times, most recently from 309d431 to e97937b Compare June 18, 2026 15:03

@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/openclaw/src/extension.spec.ts`:
- Around line 83-89: The `createContext` helper function is returning an object
missing the required `workspace` property defined in the `AgentWorkspaceContext`
interface. Add the `workspace` property to the return object (alongside the
existing `model` and `configurationFiles` properties) with an appropriate value
that satisfies the interface requirements.
🪄 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: da9138ea-52e9-43aa-984b-4620d41245ff

📥 Commits

Reviewing files that changed from the base of the PR and between ee77933 and e97937b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • extensions/openclaw/package.json
  • extensions/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/extension.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
  • GitHub Check: Linux
  • GitHub Check: smoke-e2e-tests (dev) / ubuntu-24.04 (ollama)
  • GitHub Check: macOS
  • GitHub Check: unit tests / windows-2022
  • GitHub Check: unit tests / macos-15
  • GitHub Check: linter, formatters
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: typecheck
  • GitHub Check: Windows
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.ts
extensions/*/src/extension.ts

📄 CodeRabbit inference engine (AGENTS.md)

Extensions should export a standard activation API from their entry point

Files:

  • extensions/openclaw/src/extension.ts
extensions/*/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • extensions/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.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/openclaw/src/extension.spec.ts
extensions/*/package.json

📄 CodeRabbit inference engine (AGENTS.md)

extensions/*/package.json: Extensions must declare engines.kaiden version compatibility in their package.json
Extension package.json must have main field pointing to ./dist/extension.js
Configuration properties for API keys, tokens, or secrets must use "format": "password" in the configuration definition to ensure input masking in the UI

Files:

  • extensions/openclaw/package.json
🧠 Learnings (7)
📚 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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.ts
📚 Learning: 2026-05-06T11:15:56.238Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/extension.spec.ts:43-51
Timestamp: 2026-05-06T11:15:56.238Z
Learning: In all extensions under extensions/*/src/extension.ts, deactivate() should only clear the module-level instance reference (e.g., set the instance to undefined) and must not call dispose() directly. The dispose() method is invoked by the extension host when processing extensionContext.subscriptions. Do not suggest asserting dispose() in tests for deactivate(); such assertions are unnecessary because disposal is handled by the host and CI checks should validate subscriptions handling instead.

Applied to files:

  • extensions/openclaw/src/extension.ts
📚 Learning: 2026-06-18T08:20:05.553Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 2185
File: extensions/gemini/src/extension.ts:45-52
Timestamp: 2026-06-18T08:20:05.553Z
Learning: When reviewing openkaiden/kaiden extension code that registers `configurationFiles` via `agents.registerAgent()` (typically in `extensions/*/src/extension.ts`), do not flag an intentionally stub `read()` (e.g., returning `'{}'`) as causing data loss or as a missing file-I/O implementation. Per the framework, runtime behavior uses the declared `path` and the real, file-backed `read()`/`update()` implementations are supplied through `context.configurationFiles` during `preWorkspaceStart`.

Applied to files:

  • extensions/openclaw/src/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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.ts
📚 Learning: 2026-05-06T11:29:33.170Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/package.json:9-11
Timestamp: 2026-05-06T11:29:33.170Z
Learning: In the openkaiden/kaiden repo, all built-in extensions under extensions/ should specify engines with kaiden: "^0.0.1" in package.json. Do not flag each extension individually; enforce a repo-wide alignment in a single PR. During reviews, verify that every extensions/*/package.json has "engines": { "kaiden": "^0.0.1" }. If a file deviates, surface the discrepancy as a single repo-wide task rather than per-file.

Applied to files:

  • extensions/openclaw/package.json
🔇 Additional comments (3)
extensions/openclaw/package.json (1)

23-24: LGTM!

extensions/openclaw/src/extension.ts (1)

19-52: LGTM!

Also applies to: 65-96

extensions/openclaw/src/extension.spec.ts (1)

19-23: LGTM!

Also applies to: 70-77, 91-198

Comment thread extensions/openclaw/src/extension.spec.ts
@bmahabirbu bmahabirbu force-pushed the extend-openclaw branch 2 times, most recently from 6fd1893 to 6fef9d7 Compare June 22, 2026 19:54

@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.

♻️ Duplicate comments (1)
extensions/openclaw/src/extension.spec.ts (1)

83-88: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Add required workspace property to createContext return value.

The createContext helper returns an object typed as AgentWorkspaceContext but omits the required workspace property. This violates the interface contract.

🔧 Proposed fix
 return {
   model: {
     model: { label: modelLabel },
   },
   configurationFiles: configFiles,
+  workspace: {} as AgentWorkspaceContext['workspace'],
 };
🤖 Prompt for 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.

In `@extensions/openclaw/src/extension.spec.ts` around lines 83 - 88, The
createContext helper function return value is missing the required workspace
property that is defined in the AgentWorkspaceContext interface. Update the
return object in the createContext function to include the workspace property
alongside the existing model and configurationFiles properties to satisfy the
interface contract.
🤖 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.

Duplicate comments:
In `@extensions/openclaw/src/extension.spec.ts`:
- Around line 83-88: The createContext helper function return value is missing
the required workspace property that is defined in the AgentWorkspaceContext
interface. Update the return object in the createContext function to include the
workspace property alongside the existing model and configurationFiles
properties to satisfy the interface contract.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5e55d6a4-dc61-4c3a-9a25-8eda79f57415

📥 Commits

Reviewing files that changed from the base of the PR and between e97937b and 6fef9d7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • extensions/openclaw/package.json
  • extensions/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/extension.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
extensions/*/package.json

📄 CodeRabbit inference engine (AGENTS.md)

extensions/*/package.json: Extensions must declare engines.kaiden version compatibility in their package.json
Extension package.json must have main field pointing to ./dist/extension.js
Configuration properties for API keys, tokens, or secrets must use "format": "password" in the configuration definition to ensure input masking in the UI

Files:

  • extensions/openclaw/package.json
**/*.{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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/extension.ts
extensions/*/src/extension.ts

📄 CodeRabbit inference engine (AGENTS.md)

Extensions should export a standard activation API from their entry point

Files:

  • extensions/openclaw/src/extension.ts
🧠 Learnings (7)
📚 Learning: 2026-05-06T11:29:33.170Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/package.json:9-11
Timestamp: 2026-05-06T11:29:33.170Z
Learning: In the openkaiden/kaiden repo, all built-in extensions under extensions/ should specify engines with kaiden: "^0.0.1" in package.json. Do not flag each extension individually; enforce a repo-wide alignment in a single PR. During reviews, verify that every extensions/*/package.json has "engines": { "kaiden": "^0.0.1" }. If a file deviates, surface the discrepancy as a single repo-wide task rather than per-file.

Applied to files:

  • extensions/openclaw/package.json
📚 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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/extension.ts
📚 Learning: 2026-05-06T11:15:56.238Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/extension.spec.ts:43-51
Timestamp: 2026-05-06T11:15:56.238Z
Learning: In all extensions under extensions/*/src/extension.ts, deactivate() should only clear the module-level instance reference (e.g., set the instance to undefined) and must not call dispose() directly. The dispose() method is invoked by the extension host when processing extensionContext.subscriptions. Do not suggest asserting dispose() in tests for deactivate(); such assertions are unnecessary because disposal is handled by the host and CI checks should validate subscriptions handling instead.

Applied to files:

  • extensions/openclaw/src/extension.ts
📚 Learning: 2026-06-18T08:20:05.553Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 2185
File: extensions/gemini/src/extension.ts:45-52
Timestamp: 2026-06-18T08:20:05.553Z
Learning: When reviewing openkaiden/kaiden extension code that registers `configurationFiles` via `agents.registerAgent()` (typically in `extensions/*/src/extension.ts`), do not flag an intentionally stub `read()` (e.g., returning `'{}'`) as causing data loss or as a missing file-I/O implementation. Per the framework, runtime behavior uses the declared `path` and the real, file-backed `read()`/`update()` implementations are supplied through `context.configurationFiles` during `preWorkspaceStart`.

Applied to files:

  • extensions/openclaw/src/extension.ts
🔇 Additional comments (6)
extensions/openclaw/src/extension.ts (2)

19-52: LGTM!


65-95: LGTM!

extensions/openclaw/src/extension.spec.ts (3)

19-23: LGTM!


70-77: LGTM!


91-198: LGTM!

extensions/openclaw/package.json (1)

23-24: No issues found. The engines.kaiden field is properly declared with "^0.0.1".

@jeffmaury jeffmaury 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.

MCP not implemented ?

Comment thread extensions/openclaw/src/extension.ts Outdated
.object({
defaults: JsonObjectSchema.catch({}).optional(),
})
.catchall(z.unknown())

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.

issue: should use looseObject as other extensions do

Comment thread extensions/openclaw/src/extension.ts Outdated

function parseOpenClawConfig(content: string): OpenClawConfig {
try {
const parsed: unknown = JSON.parse(content);

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.

issue: no pre parsing

@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: 2

🤖 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/openclaw/src/extension.spec.ts`:
- Around line 78-380: The `describe('preWorkspaceStart', ...)` tests repeat the
same `activate(extensionContextMock)` plus `agents.registerAgent` lookup
boilerplate in every case, so extract that setup into a local `beforeEach` or a
small helper like `getAgent()` inside this block. Keep the tests using the
shared agent instance from `activate`/`registerAgent` instead of redoing the
same two lines in each test, and leave the individual assertions unchanged.

In `@extensions/openclaw/src/extension.ts`:
- Around line 96-110: The conditional-spread checks for non-empty headers/env
are duplicated in the server and command loops, so extract that pattern into a
small reusable helper in extension.ts and use it from the mcpServers and
mcpCommands handling. Update the logic around the servers object construction
near the loops that populate server.name and cmd.name so the helper returns the
optional spread only when the object has keys, keeping the existing behavior
while removing the repeated Object.keys(...).length > 0 checks.
🪄 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: 6bbf6177-2b4a-4b5f-a380-eee2b340fdbc

📥 Commits

Reviewing files that changed from the base of the PR and between 6fef9d7 and b3c362b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • extensions/openclaw/package.json
  • extensions/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/extension.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: smoke-e2e-tests (dev) / ubuntu-24.04 (ollama)
  • GitHub Check: typecheck
  • GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
  • GitHub Check: Windows
  • GitHub Check: macOS
  • GitHub Check: unit tests / windows-2022
  • GitHub Check: Linux
  • GitHub Check: unit tests / macos-15
  • GitHub Check: linter, formatters
  • GitHub Check: unit tests / ubuntu-24.04
⚠️ CI failures not shown inline (4)

GitHub Actions: fullsend / dispatch _ Route: feat(openclaw): implement agent configuration for workspace preparation

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mif [[ -f .fullsend/config.yaml ]]; then�[0m
 �[36;1m  KILL_SWITCH=$(yq '.kill_switch // false' .fullsend/config.yaml)�[0m
 �[36;1m  if [[ "$KILL_SWITCH" == "true" ]]; then�[0m
 �[36;1m    echo "::error::Kill switch is active — all agent dispatch halted"�[0m

GitHub Actions: fullsend / dispatch _ Route: feat(openclaw): implement agent configuration for workspace preparation

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mEVENT_PAYLOAD=$(jq -c '{�[0m
 �[36;1m  issue: (.issue // null | if . then {number, html_url} else null end),�[0m
 �[36;1m  pull_request: (.pull_request // null | if . then {number, html_url,�[0m
 �[36;1m    head: {ref: .head.ref, sha: .head.sha, repo: {full_name: .head.repo.full_name}},�[0m
 �[36;1m    base: {ref: .base.ref, repo: {full_name: .base.repo.full_name}}} else null end),�[0m
 �[36;1m  comment: (.comment // null | if . then {body: .body[:4096]} else null end)�[0m
 �[36;1m}' "$GITHUB_EVENT_PATH") || {�[0m
 �[36;1m  echo "::error::Failed to extract event payload from GITHUB_EVENT_PATH"�[0m

GitHub Actions: fullsend / 6_dispatch _ Route.txt: feat(openclaw): implement agent configuration for workspace preparation

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1m�[0m
 �[36;1mif [[ ! "$STAGE" =~ ^[a-z][a-z0-9_-]*$ ]]; then�[0m
 �[36;1m  echo "::error::Invalid stage name: must start with lowercase letter and contain only [a-z0-9_-]"�[0m

GitHub Actions: fullsend / dispatch _ Route: feat(openclaw): implement agent configuration for workspace preparation

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1m�[0m
 �[36;1mif [[ ! "$STAGE" =~ ^[a-z][a-z0-9_-]*$ ]]; then�[0m
 �[36;1m  echo "::error::Invalid stage name: must start with lowercase letter and contain only [a-z0-9_-]"�[0m
🧰 Additional context used
📓 Path-based instructions (5)
extensions/*/package.json

📄 CodeRabbit inference engine (AGENTS.md)

extensions/*/package.json: Extensions must declare engines.kaiden version compatibility in their package.json
Extension package.json must have main field pointing to ./dist/extension.js
Configuration properties for API keys, tokens, or secrets must use "format": "password" in the configuration definition to ensure input masking in the UI

Files:

  • extensions/openclaw/package.json
**/*.{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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.ts
extensions/*/src/extension.ts

📄 CodeRabbit inference engine (AGENTS.md)

Extensions should export a standard activation API from their entry point

Files:

  • extensions/openclaw/src/extension.ts
extensions/*/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • extensions/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.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/openclaw/src/extension.spec.ts
🧠 Learnings (8)
📚 Learning: 2026-05-06T11:29:33.170Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/package.json:9-11
Timestamp: 2026-05-06T11:29:33.170Z
Learning: In the openkaiden/kaiden repo, all built-in extensions under extensions/ should specify engines with kaiden: "^0.0.1" in package.json. Do not flag each extension individually; enforce a repo-wide alignment in a single PR. During reviews, verify that every extensions/*/package.json has "engines": { "kaiden": "^0.0.1" }. If a file deviates, surface the discrepancy as a single repo-wide task rather than per-file.

Applied to files:

  • extensions/openclaw/package.json
📚 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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.ts
📚 Learning: 2026-05-06T11:15:56.238Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/extension.spec.ts:43-51
Timestamp: 2026-05-06T11:15:56.238Z
Learning: In all extensions under extensions/*/src/extension.ts, deactivate() should only clear the module-level instance reference (e.g., set the instance to undefined) and must not call dispose() directly. The dispose() method is invoked by the extension host when processing extensionContext.subscriptions. Do not suggest asserting dispose() in tests for deactivate(); such assertions are unnecessary because disposal is handled by the host and CI checks should validate subscriptions handling instead.

Applied to files:

  • extensions/openclaw/src/extension.ts
📚 Learning: 2026-06-18T08:20:05.553Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 2185
File: extensions/gemini/src/extension.ts:45-52
Timestamp: 2026-06-18T08:20:05.553Z
Learning: When reviewing openkaiden/kaiden extension code that registers `configurationFiles` via `agents.registerAgent()` (typically in `extensions/*/src/extension.ts`), do not flag an intentionally stub `read()` (e.g., returning `'{}'`) as causing data loss or as a missing file-I/O implementation. Per the framework, runtime behavior uses the declared `path` and the real, file-backed `read()`/`update()` implementations are supplied through `context.configurationFiles` during `preWorkspaceStart`.

Applied to files:

  • extensions/openclaw/src/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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.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/openclaw/src/extension.ts
  • extensions/openclaw/src/extension.spec.ts
🔇 Additional comments (5)
extensions/openclaw/src/extension.spec.ts (1)

69-77: LGTM!

Also applies to: 109-173, 174-341, 342-379

extensions/openclaw/package.json (1)

23-24: LGTM!

extensions/openclaw/src/extension.ts (3)

19-49: LGTM!


62-69: LGTM!

Also applies to: 74-88, 115-115


90-113: 🗄️ Data Integrity & Integration

Clarify the MCP config lifecycle

config.mcp.servers is merged with any existing entries, so removing a workspace server/command will leave the old entry in openclaw.json. If this block is meant to reflect the current workspace state, replace the map instead of merging; otherwise this behavior is fine.

Comment thread extensions/openclaw/src/extension.spec.ts
Comment thread extensions/openclaw/src/extension.ts
@bmahabirbu

Copy link
Copy Markdown
Contributor Author

@CodeRabbit resolve

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved and changes approved.

bmahabirbu and others added 3 commits July 1, 2026 19:46
Replaces the configurationFiles and preWorkspaceStart stubs with a real
implementation that writes the selected model into openclaw.json at
agents.defaults.model, preserving existing configuration fields.

Fixes: openkaiden#2175

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Brian <bmahabir@bu.edu>
…ation

Use zod schemas for type-safe config parsing with graceful fallbacks on
malformed input, replacing ad-hoc inline type assertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Brian <bmahabir@bu.edu>
Use looseObject for zod schemas, replace safeParse wrapper with direct
Schema.parse(JSON.parse(...)) to match other extensions. Add MCP server
configuration from workspace context using OpenClaw's native mcp.servers
format (command-based with {command, args, env}, URL-based with
{transport: "streamable-http", url, headers}). Fix config path from
openclaw.json to .openclaw/openclaw.json to match where OpenClaw
actually reads its configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Brian <bmahabir@bu.edu>

@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.

♻️ Duplicate comments (2)
extensions/openclaw/src/extension.ts (1)

96-110: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Duplicate "include only if non-empty" pattern.

The headers/env conditional-spread logic is repeated verbatim across both loops; this was previously flagged and remains unresolved.

♻️ Proposed helper to deduplicate the conditional spread
+function withNonEmpty<K extends string>(key: K, value: Record<string, string> | undefined): Record<K, Record<string, string>> | {} {
+  return value && Object.keys(value).length > 0 ? { [key]: value } as Record<K, Record<string, string>> : {};
+}
+
 for (const server of mcpServers ?? []) {
   servers[server.name] = {
     transport: 'streamable-http',
     url: server.url,
-    ...(server.headers && Object.keys(server.headers).length > 0 ? { headers: server.headers } : {}),
+    ...withNonEmpty('headers', server.headers),
   };
 }

 for (const cmd of mcpCommands ?? []) {
   servers[cmd.name] = {
     command: cmd.command,
     args: cmd.args ?? [],
-    ...(cmd.env && Object.keys(cmd.env).length > 0 ? { env: cmd.env } : {}),
+    ...withNonEmpty('env', cmd.env),
   };
 }
🤖 Prompt for 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.

In `@extensions/openclaw/src/extension.ts` around lines 96 - 110, The conditional
spread for “include only if non-empty” is duplicated in the server and command
loops in extension.ts. Extract that logic into a small reusable helper near the
mcpServers/mcpCommands handling, then use it in both places when building the
servers entry so the headers/env checks are defined once and reused by the
server and cmd mapping code.
extensions/openclaw/src/extension.spec.ts (1)

78-380: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Extract repeated activate + agent-lookup boilerplate.

await activate(extensionContextMock); const agent = vi.mocked(agents.registerAgent).mock.calls[0]![0]; is duplicated across all tests in this describe('preWorkspaceStart', ...) block; this was previously flagged and remains unresolved.

♻️ Proposed refactor
   describe('preWorkspaceStart', () => {
+    let agent: ReturnType<typeof vi.mocked<typeof agents.registerAgent>>['mock']['calls'][0][0];
+
+    beforeEach(async () => {
+      await activate(extensionContextMock);
+      agent = vi.mocked(agents.registerAgent).mock.calls[0]![0];
+    });
+
     function createContext(
       ...
     test('writes model configuration into openclaw.json', async () => {
-      await activate(extensionContextMock);
-      const agent = vi.mocked(agents.registerAgent).mock.calls[0]![0];
-
       const configFile = createConfigFile();
       await agent.preWorkspaceStart(createContext([configFile]));
       ...
🤖 Prompt for 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.

In `@extensions/openclaw/src/extension.spec.ts` around lines 78 - 380, The
preWorkspaceStart tests repeat the same activation and agent lookup boilerplate
in every case. Extract that setup into a small shared helper inside the describe
block, using activate(extensionContextMock) and the agents.registerAgent mock
call to return the agent, then update each test to call the helper instead of
duplicating the two lines.
🤖 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.

Duplicate comments:
In `@extensions/openclaw/src/extension.spec.ts`:
- Around line 78-380: The preWorkspaceStart tests repeat the same activation and
agent lookup boilerplate in every case. Extract that setup into a small shared
helper inside the describe block, using activate(extensionContextMock) and the
agents.registerAgent mock call to return the agent, then update each test to
call the helper instead of duplicating the two lines.

In `@extensions/openclaw/src/extension.ts`:
- Around line 96-110: The conditional spread for “include only if non-empty” is
duplicated in the server and command loops in extension.ts. Extract that logic
into a small reusable helper near the mcpServers/mcpCommands handling, then use
it in both places when building the servers entry so the headers/env checks are
defined once and reused by the server and cmd mapping code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c4ec76f7-5254-45de-9461-3f73b5c67729

📥 Commits

Reviewing files that changed from the base of the PR and between b3c362b and dfbe9c7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • extensions/openclaw/package.json
  • extensions/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/extension.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
  • GitHub Check: macOS
  • GitHub Check: Windows
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: smoke-e2e-tests (dev) / ubuntu-24.04 (ollama)
  • GitHub Check: typecheck
  • GitHub Check: Linux
  • GitHub Check: unit tests / macos-15
  • GitHub Check: unit tests / windows-2022
  • GitHub Check: linter, formatters
⚠️ CI failures not shown inline (4)

GitHub Actions: fullsend / dispatch _ Route: feat(openclaw): implement agent configuration for workspace preparation

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1m�[0m
 �[36;1mif [[ ! "$STAGE" =~ ^[a-z][a-z0-9_-]*$ ]]; then�[0m
 �[36;1m  echo "::error::Invalid stage name: must start with lowercase letter and contain only [a-z0-9_-]"�[0m

GitHub Actions: fullsend / dispatch _ Route: feat(openclaw): implement agent configuration for workspace preparation

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mif [[ -f .fullsend/config.yaml ]]; then�[0m
 �[36;1m  KILL_SWITCH=$(yq '.kill_switch // false' .fullsend/config.yaml)�[0m
 �[36;1m  if [[ "$KILL_SWITCH" == "true" ]]; then�[0m
 �[36;1m    echo "::error::Kill switch is active — all agent dispatch halted"�[0m

GitHub Actions: fullsend / 6_dispatch _ Route.txt: feat(openclaw): implement agent configuration for workspace preparation

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1m�[0m
 �[36;1mif [[ ! "$STAGE" =~ ^[a-z][a-z0-9_-]*$ ]]; then�[0m
 �[36;1m  echo "::error::Invalid stage name: must start with lowercase letter and contain only [a-z0-9_-]"�[0m

GitHub Actions: fullsend / dispatch _ Route: feat(openclaw): implement agent configuration for workspace preparation

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mEVENT_PAYLOAD=$(jq -c '{�[0m
 �[36;1m  issue: (.issue // null | if . then {number, html_url} else null end),�[0m
 �[36;1m  pull_request: (.pull_request // null | if . then {number, html_url,�[0m
 �[36;1m    head: {ref: .head.ref, sha: .head.sha, repo: {full_name: .head.repo.full_name}},�[0m
 �[36;1m    base: {ref: .base.ref, repo: {full_name: .base.repo.full_name}}} else null end),�[0m
 �[36;1m  comment: (.comment // null | if . then {body: .body[:4096]} else null end)�[0m
 �[36;1m}' "$GITHUB_EVENT_PATH") || {�[0m
 �[36;1m  echo "::error::Failed to extract event payload from GITHUB_EVENT_PATH"�[0m
🧰 Additional context used
📓 Path-based instructions (5)
extensions/*/package.json

📄 CodeRabbit inference engine (AGENTS.md)

extensions/*/package.json: Extensions must declare engines.kaiden version compatibility in their package.json
Extension package.json must have main field pointing to ./dist/extension.js
Configuration properties for API keys, tokens, or secrets must use "format": "password" in the configuration definition to ensure input masking in the UI

Files:

  • extensions/openclaw/package.json
**/*.{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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/extension.ts
extensions/*/src/extension.ts

📄 CodeRabbit inference engine (AGENTS.md)

Extensions should export a standard activation API from their entry point

Files:

  • extensions/openclaw/src/extension.ts
🧠 Learnings (8)
📚 Learning: 2026-05-06T11:29:33.170Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/package.json:9-11
Timestamp: 2026-05-06T11:29:33.170Z
Learning: In the openkaiden/kaiden repo, all built-in extensions under extensions/ should specify engines with kaiden: "^0.0.1" in package.json. Do not flag each extension individually; enforce a repo-wide alignment in a single PR. During reviews, verify that every extensions/*/package.json has "engines": { "kaiden": "^0.0.1" }. If a file deviates, surface the discrepancy as a single repo-wide task rather than per-file.

Applied to files:

  • extensions/openclaw/package.json
📚 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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/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/openclaw/src/extension.spec.ts
  • extensions/openclaw/src/extension.ts
📚 Learning: 2026-05-06T11:15:56.238Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/extension.spec.ts:43-51
Timestamp: 2026-05-06T11:15:56.238Z
Learning: In all extensions under extensions/*/src/extension.ts, deactivate() should only clear the module-level instance reference (e.g., set the instance to undefined) and must not call dispose() directly. The dispose() method is invoked by the extension host when processing extensionContext.subscriptions. Do not suggest asserting dispose() in tests for deactivate(); such assertions are unnecessary because disposal is handled by the host and CI checks should validate subscriptions handling instead.

Applied to files:

  • extensions/openclaw/src/extension.ts
📚 Learning: 2026-06-18T08:20:05.553Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 2185
File: extensions/gemini/src/extension.ts:45-52
Timestamp: 2026-06-18T08:20:05.553Z
Learning: When reviewing openkaiden/kaiden extension code that registers `configurationFiles` via `agents.registerAgent()` (typically in `extensions/*/src/extension.ts`), do not flag an intentionally stub `read()` (e.g., returning `'{}'`) as causing data loss or as a missing file-I/O implementation. Per the framework, runtime behavior uses the declared `path` and the real, file-backed `read()`/`update()` implementations are supplied through `context.configurationFiles` during `preWorkspaceStart`.

Applied to files:

  • extensions/openclaw/src/extension.ts
🔇 Additional comments (5)
extensions/openclaw/package.json (1)

23-24: LGTM!

extensions/openclaw/src/extension.ts (3)

19-49: LGTM!


51-73: LGTM!

Also applies to: 116-119


90-113: 🎯 Functional Correctness

No change needed
AgentWorkspaceMcpRemoteServer and AgentWorkspaceMcpCommandServer already line up with the name/url/headers and name/command/args/env shape used elsewhere, so this mapping matches the workspace contract.

extensions/openclaw/src/extension.spec.ts (1)

69-76: LGTM!

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.

Extend openclaw extension to handle agent configuration

3 participants