Skip to content

fix(site/src/pages/WorkspacesPage): show only parent agent apps in workspaces table#26568

Open
uzair-coder07 wants to merge 1 commit into
mainfrom
uzair/devex-459-aggregate-workspace-table-shortcuts-across-all-agents
Open

fix(site/src/pages/WorkspacesPage): show only parent agent apps in workspaces table#26568
uzair-coder07 wants to merge 1 commit into
mainfrom
uzair/devex-459-aggregate-workspace-table-shortcuts-across-all-agents

Conversation

@uzair-coder07

Copy link
Copy Markdown
Contributor

The workspaces table shortcuts row selected resources[0].agents[0], so a sub-agent that ended up first (for example the Claude/Task sub-agent created on a workspace) could replace the parent agent's launcher icons, and which apps showed depended on agent ordering.

Select the parent agent (parent_id === null) of the first non-hidden resource instead, matching the convention already used on the workspace detail page (Workspace.tsx). This keeps the shortcuts row deterministic and excludes sub-agent apps.

Refs DEVEX-459

Decision context and scope

Per the discussion on DEVEX-459, this is the agreed short-term fix:

In the short term, we should display only apps from the parent agent and make the behavior deterministic, rather than the current reported behavior of showing apps from the first discovered agent.

Out of scope (tracked as a longer-term backlog item on DEVEX-459):

  • Aggregating app shortcuts across multiple agents.
  • Changing the 4-slot cap (WORKSPACE_APPS_SLOTS).

For workspaces with multiple top-level agents, the first parent agent's apps are shown. This is deterministic but not aggregated.

A ParentAgentApps Storybook story was added (sub-agent listed first) with a play function asserting the parent agent's app renders and the sub-agent's app does not.


This PR was created by Coder Agents on behalf of @uzair-coder07.

…rkspaces table

The workspaces table shortcuts row selected resources[0].agents[0], so a sub-agent that ended up first (for example the Claude/Task sub-agent created on a workspace) could replace the parent agent's launcher icons, and the choice depended on agent ordering.

Select the parent agent (parent_id === null) of the first non-hidden resource instead, matching the convention already used on the workspace detail page. This keeps the shortcuts row deterministic and excludes sub-agent apps.
@linear-code

linear-code Bot commented Jun 22, 2026

Copy link
Copy Markdown

DEVEX-459

DEVEX-509

@uzair-coder07 uzair-coder07 marked this pull request as ready for review June 22, 2026 13:27
@uzair-coder07 uzair-coder07 requested a review from matifali June 22, 2026 13:27
@matifali

Copy link
Copy Markdown
Member

/coder-agents-review

@coder-agents-review

coder-agents-review Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-06-22 13:28 UTC by @matifali
Spend: $16.63 / $100.00

Review history
  • R1 (2026-06-22): 12 reviewers, 2 Nit, 1 Note, COMMENT. Review

deep-review v0.9.0 | Round 1 | 335d6bd..a455723

Last posted: Round 1, 3 findings (2 Nit, 1 Note), COMMENT. Review

Finding inventory

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 Nit Open WorkspacesTable.tsx:664 "depending on ordering" parses two ways R1 Leorio Yes
CRF-2 Nit Open WorkspacesTable.tsx:668 Rename agent to parentAgent to match selection semantics R1 Gon Yes
CRF-3 Note Open WorkspacesTable.tsx:655 JSDoc block has preamble padding around essential content R1 Gon Yes
CRF-4 Note Dropped by orchestrator (story comments aid Storybook scanning; comment is 3 lines and the story name alone does not convey the ordering-independence invariant) WorkspacesPageView.stories.tsx:367 Story-level comment restates what story name and play function show R1 Gon No
CRF-5 Nit Dropped by orchestrator (project convention uses filesystem path scopes in commits, naturally producing subjects over 72 chars; no stated character limit exists in AGENTS.md) WorkspacesTable.tsx:1 Commit subject is 83 characters R1 Leorio No

Round log

Round 1

Panel (12 reviewers: Bisky, Hisoka, Mafu-san, Mafuuu, Pariston, Ging-ts, Ging-react, Gon, Leorio, Nami, Komugi, Meruem). Netero: no findings. 2 Nit, 1 Note posted. 2 dropped. Reviewed against 335d6bd..a455723.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Komugi flake/determinism
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@coder-agents-review coder-agents-review 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.

Clean, well-scoped fix. The one-line production change (.at(0) to .find(a => a.parent_id === null)) replaces positional agent access with semantic selection, matching the existing convention in Workspace.tsx:218. The Storybook story is genuine: sub-agent listed first, parent second, play function asserts the parent's app renders and the sub-agent's does not. 87% test density on a 9-line production change.

Pariston tried to construct a scenario where this fix silently regresses (all-sub-agent resource, empty agents), and confirmed the null guard on line 672 handles every case. Meruem independently verified that sub-agents always share a resource with their parent (agentapi/subagent.go:156), so a resource with agents always has at least one parent. Hisoka confirmed parent_id is string | null (never undefined) in the generated types, so strict === null is safe.

Severity summary: 2 Nit, 1 Note. No correctness, security, or performance concerns.

Mafu-san flagged for visibility that sibling code paths use positional agent indexing (getMatchingAgentOrFirst in workspace.tsx:263, chatHelpers.ts:122). Those serve different use cases (terminal connection, chat agent selection) and are out of scope per DEVEX-459. Noting in case they need the same treatment later.

"The old comment was speculative, 'Lets test this getting the apps...and see what customers...think about that,' like a doctor scribbling 'tried something, let's see if the patient lives.'" (Leorio)


site/src/pages/WorkspacesPage/WorkspacesTable.tsx:655-667

Note [CRF-3] The first paragraph ("Coder is pretty flexible...") is background context that could be distilled. The essential information, first visible resource plus parent agent selection, starts at line 662. Gon proposed:

/**
 * Most workspaces have one compute resource with one agent. We take the
 * first visible resource (sorted compute-first) and its parent agent
 * (`parent_id === null`) so sub-agent apps don't replace the parent's
 * depending on ordering.
 */

Not wrong as-is; noting for author judgment.

(Gon)

🤖

🤖 This review was automatically generated with Coder Agents.

*
* For multi-agent workspaces we show the apps from the parent agent, the one
* without a `parent_id`, instead of whichever agent happens to be discovered
* first. Sub-agents, such as those created by devcontainers, are skipped so

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.

Nit [CRF-1] "their apps do not replace the parent agent's apps depending on ordering" parses two ways: (1) the ordering-dependent replacement no longer happens, or (2) whether replacement happens depends on ordering. The follow-up sentence resolves it, but a reader shouldn't have to read ahead to parse one sentence.

Suggestion:

 * Sub-agents, such as those created by devcontainers, are skipped so
 * agent ordering does not determine which apps appear.

(Leorio)

🤖

* their apps do not replace the parent agent's apps depending on ordering.
* This keeps the shortcuts row deterministic.
*/
const agent = workspace.latest_build.resources

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.

Nit [CRF-2] agent is now selected by parent_id === null, not by position. Renaming to parentAgent would carry the selection semantics to downstream uses (parentAgent.display_apps, parentAgent.apps) where the .find predicate is no longer visible.

(Gon)

🤖

Comment on lines +662 to +664
* For multi-agent workspaces we show the apps from the parent agent, the one
* without a `parent_id`, instead of whichever agent happens to be discovered
* first. Sub-agents, such as those created by devcontainers, are skipped so

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is only valid for multi-agent workspaces with child agents. There are cases when there could be multiple parent-level agents.

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.

2 participants