Skip to content

feat(openshell): build and create sandbox via openshell-image-builder - #2135

Merged
feloy merged 6 commits into
openkaiden:mainfrom
feloy:openshell
Jun 12, 2026
Merged

feloy merged 6 commits into
openkaiden:mainfrom
feloy:openshell

Conversation

@feloy

@feloy feloy commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Adds OpenShell workspace creation path: when KAIDEN_OPENSHELL is set, create() builds a container image with openshell-image-builder (passing agent, model, inference, and endpoint) then provisions the sandbox via openshell CLI instead of kdn.

Fixes #2108

See demo with opencode + local llm (ollama) + skill

kaiden-openshell.mp4

Limitations:

@feloy
feloy requested a review from a team as a code owner June 11, 2026 12:14
@feloy
feloy requested review from benoitf and jeffmaury and removed request for a team June 11, 2026 12:14
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

AgentWorkspaceManager gains an OpenShell-gated create path (KAIDEN_OPENSHELL=1) that builds a sanitized workspace image via OpenshellImageBuilder (cwd-aware) and calls OpenshellCli.createSandbox (supports noTty); tests cover the OpenShell flow and CLI flag placement.

Changes

OpenShell Workspace Creation

Layer / File(s) Summary
Image builder working directory support
packages/main/src/plugin/openshell-cli/openshell-image-builder.ts
BuildImageOptions adds optional cwd and buildImage passes { cwd: options.cwd } to exec.exec() to run the CLI in the specified directory.
OpenShell sandbox no-tty flag
packages/main/src/plugin/openshell-cli/openshell-cli.ts, packages/api/src/openshell-gateway-info.ts, packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts
CreateSandboxOptions gains optional noTty?: boolean; OpenshellCli.createSandbox conditionally inserts --no-tty before the -- separator when noTty is true; test verifies flag placement.
OpenShell workspace creation in AgentWorkspaceManager
packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
Injects OpenshellImageBuilder, branches create() on KAIDEN_OPENSHELL, adds sanitizeImageTag(), and implements createOpenshell() to write config, generate a sanitized kaiden-workspace-...:latest tag, call imageBuilderCli.buildImage() (including cwd and parsed model/inference/endpoint metadata), call openshellCli.createSandbox() with providers/labels/noTty/command, and return { id: sandboxName }.
Test coverage for OpenShell workspace creation
packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
Tests import/mock OpenshellImageBuilder, wire imageBuilderCli into AgentWorkspaceManager, enable KAIDEN_OPENSHELL=1 for the suite, assert image tag sanitization and buildImage metadata/cwd usage, assert openshellCli.createSandbox call shape (from image, providers, base64url label, noTty, command), assert returned sandbox id and that kdnCli.createWorkspace is not called.

Sequence Diagram(s)

sequenceDiagram
  participant Test
  participant AgentWorkspaceManager
  participant KdnCli
  participant OpenshellImageBuilder
  participant OpenshellCli

  Test->>AgentWorkspaceManager: create(options) with KAIDEN_OPENSHELL=1
  AgentWorkspaceManager->>KdnCli: writeWorkspaceConfig(options)
  AgentWorkspaceManager->>AgentWorkspaceManager: sanitizeImageTag(name or sourcePath)
  AgentWorkspaceManager->>OpenshellImageBuilder: buildImage(tag, { agent/model/inference/endpoint, cwd })
  OpenshellImageBuilder-->>AgentWorkspaceManager: builtImageRef
  AgentWorkspaceManager->>OpenshellCli: createSandbox({ from: builtImageRef, providers, labels (base64url sourcePath), noTty:true, command:['true'] })
  OpenshellCli-->>AgentWorkspaceManager: sandboxId
  AgentWorkspaceManager-->>Test: { id: sandboxId }
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • benoitf
  • jeffmaury
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing OpenShell workspace creation via openshell-image-builder and the OpenShell CLI.
Linked Issues check ✅ Passed All objectives from #2108 are met: openshell-image-builder is called for image creation, OpenShell sandbox is created with the image, workspace label is added via base64url-encoded sourcePath, and KAIDEN_OPENSHELL enables the mode.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the OpenShell creation path specified in #2108; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly relates to the changeset, explaining the OpenShell workspace creation path and referencing the specific issue (#2108) being fixed.

✏️ 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.

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

🤖 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 `@packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts`:
- Around line 155-160: The createSandbox call in agent-workspace-manager.ts is
missing the required engineId routing info; update the
AgentWorkspaceCreateOptions type to include an engineId field (e.g., engineId:
string) and plumb the selected engine through the workspace creation flow, then
pass that engineId into this.openshellCli.createSandbox({...}) as the engineId
property alongside name/from/providers/labels so container operations include
the engine identifier for correct multi-engine routing.
- Around line 155-160: When calling openshellCli.createSandbox in
agent-workspace-manager (the block using sandboxName, imageTag and
options.secrets), merge options.workspaceConfiguration?.secrets into the
providers list so onboarding-owned secrets are included; specifically build
providers from both options.secrets and options.workspaceConfiguration.secrets
(deduplicating if needed) before passing to createSandbox (this complements
ensureModelSecret which stores onboarding secrets separately). Update the call
site that currently passes only options.secrets to pass the merged providers
array, and add a regression test that exercises the OpenShell workspace creation
path with workspaceConfiguration.secrets to assert the created sandbox receives
those provider bindings.
- Around line 124-131: sanitizeImageTag currently can return an empty string for
names consisting only of disallowed characters; update sanitizeImageTag to
guarantee a non-empty component by appending or replacing with a stable fallback
when the sanitized result is empty (e.g., compute a short deterministic hash or
base36 suffix from the original name and return a fallback like
`fallback-<shortHash>` or prefix with `img-<shortHash>`); ensure the function
still lowercases and strips invalid chars, but if
.split(...).filter(Boolean).join('-') yields an empty string, return the
deterministic fallback so callers (e.g., image name construction that uses
sanitizeImageTag) never produce an invalid image tag.
🪄 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: e592f1d7-0fb5-406b-b67c-6e41516483ca

📥 Commits

Reviewing files that changed from the base of the PR and between 8e4998d and ee38d00.

📒 Files selected for processing (3)
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
  • packages/main/src/plugin/openshell-cli/openshell-image-builder.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 (dev) / ubuntu-24.04 (ollama)
  • GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
  • GitHub Check: Windows
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: macOS
  • GitHub Check: linter, formatters
  • GitHub Check: Linux
  • GitHub Check: unit tests / windows-2025
  • GitHub Check: unit tests / macos-15
  • GitHub Check: typecheck
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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:

  • packages/main/src/plugin/openshell-cli/openshell-image-builder.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
packages/main/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/main/src/**/*.{ts,tsx}: Use ipcHandle() to expose handlers in the main process with naming convention <registry-name>:<action> (e.g., container-provider-registry:listContainers)
Use apiSender.send() to send events from main process to renderer for real-time updates
Long-running operations should use TaskManager.createTask() with title and action configuration

Files:

  • packages/main/src/plugin/openshell-cli/openshell-image-builder.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
packages/{main,renderer,preload}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Container operations must include engineId parameter to identify the container engine

Files:

  • packages/main/src/plugin/openshell-cli/openshell-image-builder.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.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:

  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
🧠 Learnings (2)
📚 Learning: 2026-03-09T08:47:09.657Z
Learnt from: benoitf
Repo: kortex-hub/kortex PR: 1077
File: packages/main/src/plugin/skill/skill-manager.ts:80-109
Timestamp: 2026-03-09T08:47:09.657Z
Learning: In the kortex-hub/kortex repository, IPC handlers (via ipcHandle()) may be registered directly inside feature manager/service classes (e.g., SkillManager in packages/main/src/plugin/skill/skill-manager.ts) rather than exclusively in packages/main/src/plugin/index.ts. Treat this as an accepted design pattern for files under the plugin directory. Reviewers should not require centralization in index.ts; allow IPC registration proximity to the feature that owns the handler. When reviewing code, accept direct ipcHandle() registrations inside feature managers and ensure the pattern is consistently applied across similar feature-manager modules.

Applied to files:

  • packages/main/src/plugin/openshell-cli/openshell-image-builder.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.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:

  • packages/main/src/plugin/openshell-cli/openshell-image-builder.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
🪛 OpenGrep (1.22.0)
packages/main/src/plugin/openshell-cli/openshell-image-builder.ts

[ERROR] 101-101: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)

Comment thread packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
Comment thread packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/main/src/plugin/kdn-cli/kdn-cli.ts 50.00% 1 Missing ⚠️
...rc/plugin/openshell-cli/openshell-image-builder.ts 0.00% 1 Missing ⚠️
.../plugin/secret-manager/openshell-secret-adapter.ts 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@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 (3)
packages/api/src/openshell-gateway-info.ts (1)

43-56: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Add engineId to the sandbox-create contract.

CreateSandboxOptions still has no engineId, so downstream main-process container operations cannot thread engine routing information. This violates the multi-engine contract and leaves createSandbox() calls ambiguous.

Suggested diff
 export interface CreateSandboxOptions {
+  engineId: string;
   name?: string;
   gateway?: string;
   from?: string;
   gpu?: boolean;
   gpuDevice?: string;
   cpu?: string;
   memory?: string;
   providers?: string[];
   labels?: Record<string, string>;
   uploads?: Array<{ local: string; remote: string }>;
   command?: string[];
   noTty?: boolean;
 }

As per coding guidelines, container operations must include engineId parameter to identify the container engine.

🤖 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 `@packages/api/src/openshell-gateway-info.ts` around lines 43 - 56,
CreateSandboxOptions is missing engineId so engine routing can't be propagated;
add an optional engineId?: string property to the CreateSandboxOptions interface
(the object passed to createSandbox) and update any call sites or handlers that
construct or forward CreateSandboxOptions to accept and forward engineId so
container operations can route by engine. Ensure the property name is exactly
engineId and is treated as optional where not yet provided.

Source: Coding guidelines

packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts (2)

124-131: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guarantee non-empty sanitized image tags.

For names that sanitize to nothing, sanitizeImageTag() returns '', and Line 145 builds kaiden-workspace-:latest, which is invalid and breaks workspace creation.

Suggested diff
   private sanitizeImageTag(name: string): string {
-    return name
+    const sanitized = name
       .toLowerCase()
       .replace(/[^a-z0-9-]+/g, '-')
       .split('-')
       .filter(Boolean)
       .join('-');
+    if (sanitized) return sanitized;
+    const fallback = Buffer.from(name).toString('base64url').slice(0, 12).toLowerCase();
+    return `ws-${fallback || 'default'}`;
   }

Also applies to: 145-145

🤖 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 `@packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts` around
lines 124 - 131, sanitizeImageTag can return an empty string for inputs that
strip to nothing, causing invalid image names like "kaiden-workspace-:latest";
update sanitizeImageTag (and its usage) to guarantee a non-empty, valid token
by: after the current normalize/filter/join steps, fallback to a safe default
(e.g., "workspace" or "default") if the result is empty, and ensure no
leading/trailing dashes remain; reference sanitizeImageTag and the code that
composes the image name (the kaiden-workspace-... builder) to apply this change
so image tags are always valid.

155-159: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Merge onboarding secrets into providers for OpenShell sandbox creation.

Line 158 forwards only options.secrets, but ensureModelSecret() intentionally skips mutation when workspaceConfiguration.secrets is present (Line 190). That drops onboarding-owned provider bindings in OpenShell mode.

Suggested diff
+    const providers = [...new Set([...(options.secrets ?? []), ...(options.workspaceConfiguration?.secrets ?? [])])];
+
     await this.openshellCli.createSandbox({
       name: sandboxName,
       from: imageTag,
-      providers: options.secrets,
+      providers: providers.length > 0 ? providers : undefined,
       labels: { 'ai.openkaiden.kaiden.workspace': Buffer.from(options.sourcePath).toString('base64url') },
       noTty: true,
       command: ['true'],
     });
🤖 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 `@packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts` around
lines 155 - 159, The createSandbox call currently forwards only options.secrets,
which drops onboarding-owned provider bindings because ensureModelSecret()
avoids mutating when workspaceConfiguration.secrets exists; fix by merging
onboarding provider bindings into the providers passed to
openshellCli.createSandbox: compute a mergedProviders object/structure (e.g.,
combine options.secrets with the onboarding-owned providers that
ensureModelSecret or the onboarding config provides) and pass mergedProviders as
the providers argument to openshellCli.createSandbox (referencing
openshellCli.createSandbox, sandboxName, imageTag, options.secrets,
ensureModelSecret, workspaceConfiguration.secrets).
🤖 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 `@packages/api/src/openshell-gateway-info.ts`:
- Around line 43-56: CreateSandboxOptions is missing engineId so engine routing
can't be propagated; add an optional engineId?: string property to the
CreateSandboxOptions interface (the object passed to createSandbox) and update
any call sites or handlers that construct or forward CreateSandboxOptions to
accept and forward engineId so container operations can route by engine. Ensure
the property name is exactly engineId and is treated as optional where not yet
provided.

In `@packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts`:
- Around line 124-131: sanitizeImageTag can return an empty string for inputs
that strip to nothing, causing invalid image names like
"kaiden-workspace-:latest"; update sanitizeImageTag (and its usage) to guarantee
a non-empty, valid token by: after the current normalize/filter/join steps,
fallback to a safe default (e.g., "workspace" or "default") if the result is
empty, and ensure no leading/trailing dashes remain; reference sanitizeImageTag
and the code that composes the image name (the kaiden-workspace-... builder) to
apply this change so image tags are always valid.
- Around line 155-159: The createSandbox call currently forwards only
options.secrets, which drops onboarding-owned provider bindings because
ensureModelSecret() avoids mutating when workspaceConfiguration.secrets exists;
fix by merging onboarding provider bindings into the providers passed to
openshellCli.createSandbox: compute a mergedProviders object/structure (e.g.,
combine options.secrets with the onboarding-owned providers that
ensureModelSecret or the onboarding config provides) and pass mergedProviders as
the providers argument to openshellCli.createSandbox (referencing
openshellCli.createSandbox, sandboxName, imageTag, options.secrets,
ensureModelSecret, workspaceConfiguration.secrets).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 53903256-2303-4f04-8ccc-66a5efeb3a15

📥 Commits

Reviewing files that changed from the base of the PR and between ee38d00 and 852b14f.

📒 Files selected for processing (5)
  • packages/api/src/openshell-gateway-info.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
  • packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts
  • packages/main/src/plugin/openshell-cli/openshell-cli.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 (dev) / ubuntu-24.04 (ollama)
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
  • GitHub Check: Windows
  • GitHub Check: macOS
  • GitHub Check: Linux
  • GitHub Check: linter, formatters
  • GitHub Check: unit tests / windows-2025
  • GitHub Check: typecheck
  • GitHub Check: unit tests / macos-15
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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:

  • packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts
  • packages/main/src/plugin/openshell-cli/openshell-cli.ts
  • packages/api/src/openshell-gateway-info.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.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:

  • packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
packages/main/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/main/src/**/*.{ts,tsx}: Use ipcHandle() to expose handlers in the main process with naming convention <registry-name>:<action> (e.g., container-provider-registry:listContainers)
Use apiSender.send() to send events from main process to renderer for real-time updates
Long-running operations should use TaskManager.createTask() with title and action configuration

Files:

  • packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts
  • packages/main/src/plugin/openshell-cli/openshell-cli.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
packages/{main,renderer,preload}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Container operations must include engineId parameter to identify the container engine

Files:

  • packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts
  • packages/main/src/plugin/openshell-cli/openshell-cli.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
🧠 Learnings (2)
📚 Learning: 2026-03-09T08:47:09.657Z
Learnt from: benoitf
Repo: kortex-hub/kortex PR: 1077
File: packages/main/src/plugin/skill/skill-manager.ts:80-109
Timestamp: 2026-03-09T08:47:09.657Z
Learning: In the kortex-hub/kortex repository, IPC handlers (via ipcHandle()) may be registered directly inside feature manager/service classes (e.g., SkillManager in packages/main/src/plugin/skill/skill-manager.ts) rather than exclusively in packages/main/src/plugin/index.ts. Treat this as an accepted design pattern for files under the plugin directory. Reviewers should not require centralization in index.ts; allow IPC registration proximity to the feature that owns the handler. When reviewing code, accept direct ipcHandle() registrations inside feature managers and ensure the pattern is consistently applied across similar feature-manager modules.

Applied to files:

  • packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts
  • packages/main/src/plugin/openshell-cli/openshell-cli.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.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:

  • packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts
  • packages/main/src/plugin/openshell-cli/openshell-cli.ts
  • packages/api/src/openshell-gateway-info.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
  • packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
🔇 Additional comments (3)
packages/main/src/plugin/openshell-cli/openshell-cli.ts (1)

147-149: LGTM!

packages/main/src/plugin/openshell-cli/openshell-cli.spec.ts (1)

255-261: LGTM!

packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts (1)

397-404: LGTM!

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

I don't think we should build image automatically, it should be optional

as you may not be able to build the image locally and you would need to fetch the image so it would require a registry

@feloy

feloy commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

I don't think we should build image automatically, it should be optional

as you may not be able to build the image locally and you would need to fetch the image so it would require a registry

What would be the fallback when we don't build the image?

@feloy
feloy requested a review from benoitf June 11, 2026 14:56
feloy and others added 3 commits June 11, 2026 17:01
  Adds OpenShell workspace creation path: when KAIDEN_OPENSHELL is set,
  create() builds a container image with openshell-image-builder (passing
  agent, model, inference, and endpoint) then provisions the sandbox via
  openshell CLI instead of kdn.

  Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Philippe Martin <phmartin@redhat.com>
… immediately

Without these flags the sandbox create command connects interactively
and never returns, leaving the task in progress indefinitely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
…mpty

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
@feloy
feloy merged commit 3aada4d into openkaiden:main Jun 12, 2026
15 checks passed
@benoitf

benoitf commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I'm not sure to get why it has been merged without having it optional.
first experience is so slow compared to reusing community images

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.

Bind create workspace to openshell-image-builder and OpenShell

3 participants