Skip to content

feat(agent-workspaces): display mounts, environment, and agent in workspace UI#1194

Closed
MarsKubeX wants to merge 1 commit intokortex-hub:mainfrom
MarsKubeX:workspace-mounts-env-agent
Closed

feat(agent-workspaces): display mounts, environment, and agent in workspace UI#1194
MarsKubeX wants to merge 1 commit intokortex-hub:mainfrom
MarsKubeX:workspace-mounts-env-agent

Conversation

@MarsKubeX
Copy link
Copy Markdown
Contributor

Bump kortex-cli-api and kortex-workspace-configuration to 0.1.7. The workspace configuration schema replaced name with mounts and environment; the CLI schema added an agent field. The Details page now shows mounts (dependencies, configs), environment variables with secret indicators, and the agent. The Card also displays the agent below the workspace name.

Closes #1182

…kspace UI

Bump kortex-cli-api and kortex-workspace-configuration to 0.1.7.
The workspace configuration schema replaced `name` with `mounts`
and `environment`; the CLI schema added an `agent` field. The Details
page now shows mounts (dependencies, configs), environment variables
with secret indicators, and the agent. The Card also displays the
agent below the workspace name.

Closes kortex-hub#1182

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Marcel Bertagnini <mbertagn@redhat.com>
@MarsKubeX MarsKubeX requested a review from a team as a code owner March 27, 2026 13:49
@MarsKubeX MarsKubeX requested review from benoitf, fbricon, feloy and gastoner and removed request for a team March 27, 2026 13:49
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

This PR adds support for displaying workspace agent identifiers, mounts (dependencies and configs), and environment variables throughout the agent workspace UI. It includes dependency version bumps, updated mock data with new configuration structures, and enhanced UI components with comprehensive test coverage.

Changes

Cohort / File(s) Summary
Dependency Updates
package.json
Bumped @kortex-hub/kortex-cli-api from ^0.1.6 to ^0.1.7 and @kortex-hub/kortex-workspace-configuration from ^0.1.4 to ^0.1.7.
Mock Data
packages/main/src/plugin/agent-workspace/agent-workspace-mock-data.ts
Added agent field to INITIAL_SUMMARIES entries (claude and codex); replaced configuration name fields with mounts (dependencies, configs) and environment structures (including OPENAI_API_KEY, LOG_LEVEL, CI, NODE_ENV, API_TOKEN entries with value and secret variants).
Card Component
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.svelte, AgentWorkspaceCard.spec.ts
Updated card to display robot icon and workspace.agent below workspace name; added test case verifying agent name rendering with extended fixture to include agent property.
Details Component
packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte, AgentWorkspaceDetails.spec.ts
Refactored remove flow to use parameterless handleRemove with workspaceSummary?.name for confirmation; replaced configuration name row with conditional "Agent" display; added conditional "Mounts" section with dependencies/configs subsections; added "Environment" section with value/secret rendering and key icon for secrets; page title now derives from workspaceSummary?.name. Comprehensive test suite added covering new sections, conditional rendering, mocking of tinro router, and fixture updates with mounts and environment properties.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: displaying mounts, environment, and agent in the workspace UI, which aligns with all modified files.
Description check ✅ Passed The description is clearly related to the changeset, explaining dependency bumps, schema changes, and UI updates across Details and Card components.
Linked Issues check ✅ Passed All primary objectives from issue #1182 are met: dependencies bumped, mock data updated, mounts/environment/agent displayed in UI, and tests added/updated.
Out of Scope Changes check ✅ Passed All changes directly support the linked issue objectives; no unrelated code modifications are present in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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
Copy Markdown

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

🤖 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/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte`:
- Around line 97-121: The Mounts section guard uses the nullish coalescing of
dependencies length which hides configs when dependencies exists but is an empty
array; update the outer condition in AgentWorkspaceDetails.svelte to explicitly
check both lengths (e.g., use a logical OR between
configuration.mounts?.dependencies?.length and
configuration.mounts?.configs?.length) so configs-only workspaces render, and
add a regression test for a workspace with { dependencies: [], configs: ['.ssh']
} to ensure the Mounts/Configs rows appear.
- Line 65: The DetailsPage header is rendering an empty string while
workspaceSummary hasn't loaded; update the title prop in
AgentWorkspaceDetails.svelte to use workspaceId as a fallback (e.g.,
title={workspaceSummary?.name ?? workspaceId}) so the page header stays stable
until agentWorkspaces resolves the summary.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7ede4bdf-d85f-41b9-b5d6-a1433f6dc634

📥 Commits

Reviewing files that changed from the base of the PR and between 757516e and d5c8221.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • package.json
  • packages/main/src/plugin/agent-workspace/agent-workspace-mock-data.ts
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.spec.ts
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceCard.svelte
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.spec.ts
  • packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte

</div>
{:then configuration}
<DetailsPage title={configuration.name ?? ''}>
<DetailsPage title={workspaceSummary?.name ?? ''}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid rendering a blank details title when the summary store is not ready.

If agentWorkspaces has not resolved this workspace yet, the page header collapses to '' even though the configuration view can still load. Falling back to workspaceId keeps the title stable until the summary arrives.

💡 Proposed fix
-  <DetailsPage title={workspaceSummary?.name ?? ''}>
+  <DetailsPage title={workspaceSummary?.name ?? workspaceId}>
📝 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
<DetailsPage title={workspaceSummary?.name ?? ''}>
<DetailsPage title={workspaceSummary?.name ?? workspaceId}>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte` at
line 65, The DetailsPage header is rendering an empty string while
workspaceSummary hasn't loaded; update the title prop in
AgentWorkspaceDetails.svelte to use workspaceId as a fallback (e.g.,
title={workspaceSummary?.name ?? workspaceId}) so the page header stays stable
until agentWorkspaces resolves the summary.

Comment on lines +97 to +121
{#if configuration.mounts?.dependencies?.length ?? configuration.mounts?.configs?.length}
<tr>
<DetailsTitle>Mounts</DetailsTitle>
</tr>
{#if configuration.mounts?.dependencies?.length}
<tr>
<DetailsCell>Dependencies</DetailsCell>
<DetailsCell>
{#each configuration.mounts.dependencies as dep (dep)}
<span class="block">{dep}</span>
{/each}
</DetailsCell>
</tr>
{/if}
{#if configuration.mounts?.configs?.length}
<tr>
<DetailsCell>Configs</DetailsCell>
<DetailsCell>
{#each configuration.mounts.configs as cfg (cfg)}
<span class="block">{cfg}</span>
{/each}
</DetailsCell>
</tr>
{/if}
{/if}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the mounts guard for configs-only workspaces.

This condition skips configs whenever dependencies is present but empty, so a configuration like { dependencies: [], configs: ['.ssh'] } hides the entire Mounts section. Check both lengths explicitly instead, and add a configs-only regression case while touching this.

🐛 Proposed fix
-            {`#if` configuration.mounts?.dependencies?.length ?? configuration.mounts?.configs?.length}
+            {`#if` (configuration.mounts?.dependencies?.length ?? 0) > 0 || (configuration.mounts?.configs?.length ?? 0) > 0}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/renderer/src/lib/agent-workspaces/AgentWorkspaceDetails.svelte`
around lines 97 - 121, The Mounts section guard uses the nullish coalescing of
dependencies length which hides configs when dependencies exists but is an empty
array; update the outer condition in AgentWorkspaceDetails.svelte to explicitly
check both lengths (e.g., use a logical OR between
configuration.mounts?.dependencies?.length and
configuration.mounts?.configs?.length) so configs-only workspaces render, and
add a regression test for a workspace with { dependencies: [], configs: ['.ssh']
} to ensure the Mounts/Configs rows appear.

@feloy
Copy link
Copy Markdown
Contributor

feloy commented Mar 27, 2026

The format will change with kortex-hub/kortex-cli-api#21. Do you want to integrate the previous version, or wait that the new is merged?

@MarsKubeX
Copy link
Copy Markdown
Contributor Author

The format will change with kortex-hub/kortex-cli-api#21. Do you want to integrate the previous version, or wait that the new is merged?

In that case I'll wait for the new version in kortex-hub/kortex-cli-api#21.

@MarsKubeX MarsKubeX closed this Mar 27, 2026
@MarsKubeX MarsKubeX deleted the workspace-mounts-env-agent branch March 27, 2026 15:19
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.

Display mounts, environment, and agent in Workspace Details and Cards

2 participants