Skip to content

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

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

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

Conversation

@bmahabirbu

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

Test plan

  • Unit tests pass (13/13)
  • Verify model label is correctly written to openclaw.json
  • Verify existing config fields are preserved when updating

🤖 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 gains typed openclaw.json configuration handling via zod. A new parseOpenClawConfig helper and exported OPENCLAW_CONFIG_PATH constant are added. Agent registration now declares openclaw.json in configurationFiles, and preWorkspaceStart is implemented to merge the workspace model label into agents.defaults.model and persist the result.

Changes

Openclaw configuration file handling

Layer / File(s) Summary
Zod schema, parseOpenClawConfig, and OPENCLAW_CONFIG_PATH
extensions/openclaw/package.json, extensions/openclaw/src/extension.ts
Adds zod ^4.4.3 as a runtime dependency and introduces the exported OPENCLAW_CONFIG_PATH constant, zod schemas for the expected openclaw.json shape, and a parseOpenClawConfig helper that safely falls back to {} on parse or validation errors.
Agent configurationFiles wiring and preWorkspaceStart
extensions/openclaw/src/extension.ts
Registers openclaw.json in configurationFiles with a default async read() returning '{}'. Replaces the unimplemented preWorkspaceStart stub with logic that reads and parses the config, merges agents.defaults.model from the active workspace model label, and persists the result via configFile.update.
Tests for configurationFiles and preWorkspaceStart
extensions/openclaw/src/extension.spec.ts
Imports OPENCLAW_CONFIG_PATH and workspace and config-file types; asserts the registered agent declares exactly one config file matching OPENCLAW_CONFIG_PATH; adds a preWorkspaceStart suite covering model-label injection, existing-field preservation, fallback behavior for invalid agents and agents.defaults, non-object and invalid JSON payloads, and no-op when the config file is absent from the context.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • openkaiden/kaiden#2168: Introduced the configurationFiles and preWorkspaceStart stub (throwing "not implemented") in the Openclaw extension that this PR replaces with a real implementation.
  • openkaiden/kaiden#2185: Implements the same configurationFiles plus preWorkspaceStart pattern (parse agent config JSON, inject workspace model label, call configFile.update) for a different extension, making it a direct structural parallel.
  • openkaiden/kaiden#2189: Adds an agent configurationFiles entry and a preWorkspaceStart hook that reads and updates persisted model fields in another extension's JSON config, following the same API pattern used here.

Suggested reviewers

  • benoitf
  • jeffmaury
🚥 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 accurately describes the main change: implementing agent configuration for workspace preparation in the openclaw extension, which is the core objective of the PR.
Description check ✅ Passed The description clearly relates to the changeset, explaining the implementation of configurationFiles and preWorkspaceStart to write model selection to openclaw.json while preserving existing fields.
Linked Issues check ✅ Passed The PR successfully implements the agent configuration feature requested in #2175 by adding zod validation, exporting OPENCLAW_CONFIG_PATH, and implementing preWorkspaceStart to persist the workspace model to openclaw.json while preserving existing configuration.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing agent configuration for workspace preparation: zod dependency addition, configuration file wiring, preWorkspaceStart implementation, and comprehensive test coverage.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
extensions/openclaw/src/extension.ts 90.00% 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 on lines +83 to +89
return {
model: {
model: { label: modelLabel },
},
configurationFiles: configFiles,
};
}

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify AgentWorkspaceContext contract and helper shape.
set -euo pipefail

echo "1) Confirm AgentWorkspaceContext requires workspace"
rg -n -C3 "interface AgentWorkspaceContext|readonly workspace" packages/extension-api/src/extension-api.d.ts

echo
echo "2) Inspect createContext helper implementation"
rg -n -C5 "function createContext|return \\{" extensions/openclaw/src/extension.spec.ts

Repository: openkaiden/kaiden

Length of output: 1189


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 and will cause TypeScript type-checking to fail.

Proposed fix
      return {
        model: {
          model: { label: modelLabel },
        },
        configurationFiles: configFiles,
+       workspace: {} as AgentWorkspaceContext['workspace'],
      };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return {
model: {
model: { label: modelLabel },
},
configurationFiles: configFiles,
};
}
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 - 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.

bmahabirbu and others added 2 commits June 22, 2026 15:53
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>

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

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

2 participants