Skip to content

feat(workspace-manager): added remove workspace#1085

Merged
MarsKubeX merged 2 commits intokortex-hub:mainfrom
MarsKubeX:feat/agent-workspace-manager-remove
Mar 11, 2026
Merged

feat(workspace-manager): added remove workspace#1085
MarsKubeX merged 2 commits intokortex-hub:mainfrom
MarsKubeX:feat/agent-workspace-manager-remove

Conversation

@MarsKubeX
Copy link
Contributor

@MarsKubeX MarsKubeX commented Mar 10, 2026

Added remove feat to the agent workspace manager.

Part of #1039

Signed-off-by: Marcel Bertagnini <mbertagn@redhat.com>
@MarsKubeX MarsKubeX requested a review from a team as a code owner March 10, 2026 16:10
@MarsKubeX MarsKubeX requested review from benoitf and gastoner and removed request for a team March 10, 2026 16:10
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a27983af-2f54-4c84-9875-7edf85a063d3

📥 Commits

Reviewing files that changed from the base of the PR and between 0dc0b99 and 247d24e.

📒 Files selected for processing (1)
  • packages/preload/src/index.ts

📝 Walkthrough

Walkthrough

Adds agent workspace removal: manager exposes remove(id), an IPC handler agent-workspace:remove is registered, mock data gains a mutable store with mockRemoveWorkspace(id), preload exposes removeAgentWorkspace, and tests cover removal success and error propagation.

Changes

Cohort / File(s) Summary
Manager & IPC
packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts
Adds remove(id: string) delegating to mockRemoveWorkspace() and registers IPC handler agent-workspace:remove.
Mock data & store
packages/main/src/plugin/agent-workspace/agent-workspace-mock-data.ts
Renames SUMMARIESINITIAL_SUMMARIES, introduces mutable store initialized from INITIAL_SUMMARIES, changes mockListWorkspaces() to return a clone of store, and adds mockRemoveWorkspace(id) which removes by id or throws if not found.
Preload bridge
packages/preload/src/index.ts
Exposes removeAgentWorkspace(id: string): Promise<void> which invokes IPC channel agent-workspace:remove.
Tests
packages/main/src/plugin/agent-workspace/agent-workspace-manager.spec.ts
Imports mockRemoveWorkspace, adds tests verifying IPC handler registration for agent-workspace:remove, successful delegation to mockRemoveWorkspace, and error propagation for unknown ids.

Sequence Diagram(s)

sequenceDiagram
  participant Renderer as Renderer
  participant Preload as Preload (bridge)
  participant Main as Main (IPC/AgentWorkspaceManager)
  participant Store as Mock Store

  Renderer->>Preload: call removeAgentWorkspace(id)
  Preload->>Main: ipcInvoke "agent-workspace:remove" (id)
  Main->>Main: AgentWorkspaceManager.remove(id)
  Main->>Store: mockRemoveWorkspace(id)
  Store-->>Main: success / throw Error
  Main-->>Preload: resolve / reject
  Preload-->>Renderer: Promise resolves / rejects
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a remove workspace feature to the agent workspace manager.
Description check ✅ Passed The description is directly related to the changeset, stating that it adds a remove feature to the agent workspace manager and references issue #1039.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

Copy link

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@packages/main/src/plugin/agent-workspace/agent-workspace-manager.ts`:
- Around line 56-58: The new IPC channel 'agent-workspace:remove' is registered
in the main but not exposed to the renderer; add a corresponding contextBridge
exposure in the preload layer by calling
contextBridge.exposeInMainWorld('removeAgentWorkspace', async (id: string) =>
ipcInvoke('agent-workspace:remove', id)); ensure you import/use the same
ipcInvoke helper used for listAgentWorkspaces so the renderer can call
removeAgentWorkspace(id) and reach the main handler (pair with the existing
ipcHandle in agent-workspace-manager).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 683e428c-e479-4a6d-8055-fd9e9169cd1b

📥 Commits

Reviewing files that changed from the base of the PR and between e091938 and 0dc0b99.

📒 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/agent-workspace/agent-workspace-mock-data.ts

Signed-off-by: Marcel Bertagnini <mbertagn@redhat.com>
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 42.85714% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...lugin/agent-workspace/agent-workspace-mock-data.ts 25.00% 6 Missing ⚠️
.../plugin/agent-workspace/agent-workspace-manager.ts 75.00% 1 Missing ⚠️
packages/preload/src/index.ts 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

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

LGTM

@MarsKubeX MarsKubeX merged commit dbdf824 into kortex-hub:main Mar 11, 2026
15 checks passed
@MarsKubeX MarsKubeX linked an issue Mar 11, 2026 that may be closed by this pull request
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.

Create a mock component to manage agent workspaces

3 participants