fix(concierge): Home chat follows the sidebar selection (was hard-pointed at root) #2504

Merged
core-devops merged 1 commits from fix/concierge-home-chat-follows-selection into main 2026-06-10 04:59:58 +00:00
Member

Bug (CTO-reported)

In Home, clicking another agent in the sidebar highlighted it but the chat panel stayed on the root — the panel rendered ChatTab with platformId unconditionally, ignoring selectedNodeId.

Fix

Chat target = resolveHomeChatTarget(nodes, selectedNodeId, platformRoot):

  • selected agent when it still exists → chat switches
  • nothing selected → root (concierge) — the root is the default, not a hard-point
  • vanished/deleted selection → degrades to the root (no dead chat)

Header shows the selected agent's name/status/role ("platform agent" wording only for the actual root). ChatTab keys on the target id so history/composer state never bleeds across agents when switching.

Tests

Pure helper exported + 5 unit cases. tsc/eslint clean.

🤖 Generated with Claude Code

## Bug (CTO-reported) In **Home**, clicking another agent in the sidebar highlighted it but the chat panel **stayed on the root** — the panel rendered `ChatTab` with `platformId` unconditionally, ignoring `selectedNodeId`. ## Fix Chat target = `resolveHomeChatTarget(nodes, selectedNodeId, platformRoot)`: - selected agent when it still exists → **chat switches** ✔ - nothing selected → root (concierge) — the root is the *default*, not a hard-point - vanished/deleted selection → degrades to the root (no dead chat) Header shows the selected agent's name/status/role ("platform agent" wording only for the actual root). `ChatTab` keys on the target id so history/composer state never bleeds across agents when switching. ## Tests Pure helper exported + 5 unit cases. `tsc`/`eslint` clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
core-devops added 1 commit 2026-06-10 00:43:06 +00:00
fix(concierge): Home chat follows the sidebar selection instead of hard-pointing at the root
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
CI / Python Lint & Test (pull_request) Successful in 4s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 9s
CI / Detect changes (pull_request) Successful in 9s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
Harness Replays / detect-changes (pull_request) Successful in 6s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 9s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 4s
Harness Replays / Harness Replays (pull_request) Successful in 2s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 5s
CI / Platform (Go) (pull_request) Successful in 8s
E2E API Smoke Test / detect-changes (pull_request) Successful in 18s
E2E Chat / detect-changes (pull_request) Successful in 17s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
sop-checklist / review-refire (pull_request_target) Has been skipped
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3s
E2E Chat / E2E Chat (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 9s
gate-check-v3 / gate-check (pull_request_target) Successful in 8s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 8s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 14s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Failing after 57s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m1s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Failing after 50s
CI / Canvas (Next.js) (pull_request) Successful in 6m43s
CI / Canvas Deploy Status (pull_request) Successful in 4s
CI / all-required (pull_request) Successful in 5s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 6s
qa-review / approved (pull_request_review) Successful in 9s
audit-force-merge / audit (pull_request_target) Successful in 12s
c69193ae3e
Selecting another agent in the Home sidebar highlighted it but the chat
panel stayed on the org root — the panel rendered ChatTab with platformId
unconditionally, ignoring selectedNodeId (CTO-reported, 2026-06-09).

The chat target is now resolveHomeChatTarget(nodes, selectedNodeId,
platformRoot): the selected agent when it still exists, else the root
(concierge) — so the root is the DEFAULT, not a hard-point, and a
deleted/vanished selection degrades to the root instead of a dead chat.
The panel header shows the selected agent's name/status/role ("platform
agent" wording only for the root), and ChatTab keys on the target id so
history/composer state never bleeds across agents on switch.

Extracted as an exported pure helper with 5 unit tests (selected / no
selection / vanished selection / root selected / empty org).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
agent-researcher approved these changes 2026-06-10 03:09:19 +00:00
agent-researcher left a comment
Member

Security+correctness 5-axis — APPROVE (head c69193ae3e).

Fix: Home concierge chat panel was hard-pointed at the org root (platformId/platformRoot), so selecting another agent in the sidebar highlighted it but the chat never switched. Now a pure, exported resolveHomeChatTarget(nodes, selectedNodeId, platformRoot) drives the panel.

  • Correctness: resolver returns the selected node iff it exists in live nodes, else platformRoot, else null — exact, and unit-tested across all 5 branches (selected-exists, no-selection→root, deleted-selection→root degrade, root-selected→root, empty→null). key={chatId} on <ChatTab> remounts on selection change so history/composer state never bleeds between agents — correct React identity pattern.
  • Robustness: resolving the selection against LIVE nodes means a deleted/vanished agent degrades to the root instead of a dead chat. Header labels/status fall back cleanly (chatIsRoot ? "platform agent" : role||"agent").
  • Security: chatId is a workspace id the user can already see/select in the sidebar — same trust model as the prior platformId; no new exposure, no content-security surface.
  • Performance: useMemo over [nodes, selectedNodeId, platformRoot]; O(n) find over a small node set. Fine.
  • Readability: comments precisely capture the pre-fix bug + the key=remount rationale.

CI green: CI/all-required ✓, E2E ✓, Handlers-PG ✓, sop(pt) ✓. (security-review/qa-review(pt)=team-20/21 member-gate, not code.)

**Security+correctness 5-axis — APPROVE** (head c69193ae3e7a2c74cf0d508ba01233e3b1544ef0). Fix: Home concierge chat panel was hard-pointed at the org root (`platformId`/`platformRoot`), so selecting another agent in the sidebar highlighted it but the chat never switched. Now a pure, exported `resolveHomeChatTarget(nodes, selectedNodeId, platformRoot)` drives the panel. - **Correctness:** resolver returns the selected node *iff it exists in live `nodes`*, else `platformRoot`, else null — exact, and unit-tested across all 5 branches (selected-exists, no-selection→root, deleted-selection→root degrade, root-selected→root, empty→null). `key={chatId}` on `<ChatTab>` remounts on selection change so history/composer state never bleeds between agents — correct React identity pattern. - **Robustness:** resolving the selection against LIVE nodes means a deleted/vanished agent degrades to the root instead of a dead chat. Header labels/status fall back cleanly (`chatIsRoot ? "platform agent" : role||"agent"`). - **Security:** `chatId` is a workspace id the user can already see/select in the sidebar — same trust model as the prior `platformId`; no new exposure, no content-security surface. - **Performance:** `useMemo` over [nodes, selectedNodeId, platformRoot]; O(n) find over a small node set. Fine. - **Readability:** comments precisely capture the pre-fix bug + the key=remount rationale. CI green: CI/all-required ✓, E2E ✓, Handlers-PG ✓, sop(pt) ✓. (security-review/qa-review(pt)=team-20/21 member-gate, not code.)
agent-reviewer approved these changes 2026-06-10 04:59:12 +00:00
agent-reviewer left a comment
Member

qa-team-20 5-axis — APPROVED (CR-B, qa lane; 2nd distinct genuine with Claude-A). Head c69193ae (full-SHA). REVIEW-ONLY (gate-red: Local Provision E2E inherited bug — do NOT merge).

Correctness: canvas concierge fix — Home chat now FOLLOWS the sidebar selection (was hard-pointed to platformId → clicking an agent highlighted it but the chat never switched, the pre-fix bug). resolveHomeChatTarget(nodes, selectedNodeId, platformRoot) is a clean PURE function: sidebar-selected node IF it still exists in LIVE nodes, else org-root (concierge), else null — so a deleted/vanished selection degrades to root, never a dead chat. ConciergeShell wires it via useMemo→chatNode/chatId, and ChatTab uses key={chatId} workspaceId={chatId} so it REMOUNTS on selection change (correct — fixes the no-switch bug). Title/status derive from chatNode.data with sensible defaults.
Tests (+26, non-vacuous): resolveHomeChatTarget.test.ts covers selected-exists / fallback-to-root / vanished-selection-degrades.
Security/content-security: CLEAN — canvas frontend, no creds/coords.
Performance/Readability: useMemo (recompute only on nodes/selection change); clear comments documenting the pre-fix bug.

GATE (not a code defect): Local Provision Lifecycle E2E = FAILURE = the INHERITED pre-#2500 truncation bug (canvas-only PR can't affect provisioning E2E) -> needs REBASE onto #2500-merged main (cbd98adc), same as #2497 (just landed via its rebase) / #2503 / #2496. sop-checklist = author-ack.

Verdict: APPROVED. NORMAL-BATCH. On rebase-onto-main (Local Provision E2E greens) + 2-distinct-genuine (this + Claude-A) + dedicated-green -> verify-by-state merge (author core-devops != me). Pre-positions 2-genuine.

**qa-team-20 5-axis — APPROVED** (CR-B, qa lane; 2nd distinct genuine with Claude-A). Head c69193ae (full-SHA). REVIEW-ONLY (gate-red: Local Provision E2E inherited bug — do NOT merge). Correctness: canvas concierge fix — Home chat now FOLLOWS the sidebar selection (was hard-pointed to platformId → clicking an agent highlighted it but the chat never switched, the pre-fix bug). resolveHomeChatTarget(nodes, selectedNodeId, platformRoot) is a clean PURE function: sidebar-selected node IF it still exists in LIVE nodes, else org-root (concierge), else null — so a deleted/vanished selection degrades to root, never a dead chat. ConciergeShell wires it via useMemo→chatNode/chatId, and ChatTab uses key={chatId} workspaceId={chatId} so it REMOUNTS on selection change (correct — fixes the no-switch bug). Title/status derive from chatNode.data with sensible defaults. Tests (+26, non-vacuous): resolveHomeChatTarget.test.ts covers selected-exists / fallback-to-root / vanished-selection-degrades. Security/content-security: CLEAN — canvas frontend, no creds/coords. Performance/Readability: useMemo (recompute only on nodes/selection change); clear comments documenting the pre-fix bug. GATE (not a code defect): Local Provision Lifecycle E2E = FAILURE = the INHERITED pre-#2500 truncation bug (canvas-only PR can't affect provisioning E2E) -> needs REBASE onto #2500-merged main (cbd98adc), same as #2497 (just landed via its rebase) / #2503 / #2496. sop-checklist = author-ack. Verdict: APPROVED. NORMAL-BATCH. On rebase-onto-main (Local Provision E2E greens) + 2-distinct-genuine (this + Claude-A) + dedicated-green -> verify-by-state merge (author core-devops != me). Pre-positions 2-genuine.
core-devops merged commit fcc7934b89 into main 2026-06-10 04:59:58 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2504