Skip to content

fix(ui): list every agent's boards in the dashboards gallery - #188486

Closed
wangmiao0668000666 wants to merge 1 commit into
openclaw:mainfrom
wangmiao0668000666:fix/dashboards-gallery-agent-scope
Closed

wangmiao0668000666 wants to merge 1 commit into
openclaw:mainfrom
wangmiao0668000666:fix/dashboards-gallery-agent-scope

Conversation

@wangmiao0668000666

Copy link
Copy Markdown
Contributor

Fixes #188449

What Problem This Solves

The /dashboards gallery scoped its listing request to whichever agent was selected in the sidebar. With two agents that each own a board, opening /dashboards from core-router listed only core-router's board, and opening it from finance-agent listed only that one — even though the page's own Author filter reads "All authors" and the docs describe it as a gallery of dashboard-enabled threads.

User Impact

/dashboards lists every agent's boards again, matching the page's author filter and the documented "Find your dashboards" behaviour. Selecting an agent still scopes the sidebar's dashboard catalog exactly as before; only the gallery stopped narrowing itself. Search, author filter, sorting, pagination, archived rows (archivedFilter: "all"), stale-data retention and retry behaviour are unchanged.

Why This Change Was Made

The gallery loader and the page's reactive list source both built their query with dashboardSessionListQuery(context.agentSelection.state.scopeId), which adds agentId to the sessions.list params. The page also subscribed to agentSelection and called list.replaceSource whenever the selected agent changed, re-scoping the gallery on every selection receipt.

Both places now call dashboardSessionListQuery() with no agent, which is the shape ui/src/components/sidebar-navigation-catalog.ts already uses as the cross-agent baseline before narrowing it for the sidebar catalog (dashboardSessionListQuery(scope[1]) there feeds the agent-scoped sidebar list, which keeps its behaviour). That removes the agent-scoped replaceSource subscription from the page, so the listing source is created once.

The sidebar catalog is a separate consumer and was left untouched; the docs already describe the gallery as cross-agent, so no doc change is needed.

Classification: behavior-completing — the gallery regains the contract its author filter and docs already advertise. Runtime production delta is net −4 lines (route.ts +2/−1, dashboards-page.tsx +2/−11); the rest of the diff updates the two owner tests.

git log -S shows the scope has been in the gallery loader since the feature landed in #114262 and in the reactive page since #177950; this change removes it from both.

Evidence

Evidence tier: producer-chain for the request params (every input is produced by the route loader/page against a stub sessions capability) and owner-test for the page's reactive source. The gallery is UI code; no model or channel boundary is involved.

Environment: remote Linux docker (lexiflow-all, Node 24.18.0), pnpm v12.15.0, test/vitest/vitest.ui.config.ts, OPENCLAW_VITEST_RUNTIME=node, FS_SAFE_NATIVE_MODE=off.

RED — current main 4be8aab577a production files with only the two candidate test files copied in (same tree, same node_modules, same command):

node_modules/.bin/vitest run --config test/vitest/vitest.ui.config.ts \
  ui/src/pages/dashboards/dashboards-page.test.tsx ui/src/pages/dashboards/route.test.ts --maxWorkers=1
FAIL ui/src/pages/dashboards/dashboards-page.test.tsx:203:39
  expect(listListeners.has("writer")).toBe(false);   // received true
FAIL ui/src/pages/dashboards/route.test.ts > loads every agent's boards regardless of the selected agent
  - Expected      + Received
      {               {
  +     "agentId": "finance-agent",
        "archivedFilter": "all",
  ...
 Test Files  2 failed (2)
      Tests  2 failed | 7 passed (9)

Both failures are at the expected assertions: the gallery re-subscribed to the selected agent's list, and the loader forwarded agentId: "finance-agent".

GREEN — candidate 132d6202458, same command, same tree layout:

✓ dashboards-page.test.tsx > keeps every agent's rows through agent selection and route updates
✓ route.test.ts > loads every agent's boards regardless of the selected agent
Test Files  2 passed (2)
      Tests  9 passed (9)
   Duration  12.97s

Control group: the other 7 cases in these two files (held first read + error retry, late-page retirement, search/author filter/sort rendering, and the three configured-scope seeds) pass on both trees, so the change neither breaks the sidebar-scope contract nor the gallery's existing behaviour.

Touched-file typecheck (tsc --noEmit -p ui/tsconfig.json) reports no diagnostics for the four changed files; oxlint ui/src/pages/dashboards/ is clean. git diff --check is clean.

Not tested: no browser/E2E run against a real Gateway, so the visual gallery on a two-agent install was not re-inspected; the claim is limited to the sessions.list params the gallery issues and the page's list subscription. The sidebar catalog's own agent-scoped query was not exercised beyond its unchanged unit coverage. /dashboards pagination and stale-data retention were covered by the passing existing cases, not by a live Gateway.

Cleanup: all runs used isolated trees under /data/openclaw-test/{base,cand}-188449 with no access to any real Gateway, session, token or config; nothing was written to the local workstation's OpenClaw state.

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

The gallery lists dashboards across agents and stops replacing its query when sidebar agent selection changes.

Example: core-router owns Morning Digest and finance-agent owns Financial digest.

  • Before: Opening /dashboards with finance-agent selected lists only Financial digest.
  • After: The gallery lists both dashboards regardless of the sidebar selection.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The production patch is small and internally consistent, but required real-behavior proof is absent and product direction remains unresolved.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Existing dashboards appear missing because the gallery silently inherits the previously selected agent.
Reason: The discovery problem merits a fix, but this proposal changes behavior maintained since the feature’s introduction rather than restoring a demonstrated former all-agent contract.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this PR addresses a real dashboard-discovery problem, but changing the gallery’s established agent scope needs an owner decision.

Priority: P2
Reviewed head: 132d620245840d4bb6f07c52203d3614bd60c317
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should the gallery expose the shared agent selector or always list accessible dashboards independently of sidebar agent selection?
  • Recommendation: Expose shared agent scope: Retain the existing query ownership and add AgentScopeControl, including All agents, so users can see and change the restriction.
  • Why: The scope dates to the original feature and was preserved by subsequent owner refactors; author filtering and documentation do not settle the intended agent boundary, and no maintainer has approved this change.

Before merge

  • Add real behavior proof - The route and mounted gallery are exercised through stub session capabilities in Vitest, with supplied red/green output; no shipped browser entry point against a real Gateway demonstrates both agents’ boards or the unchanged sidebar behavior. Add sanitized before/after screenshots or a recording with supporting live output, redacting IPs, API keys, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Tests

  • Low-value test ui/src/pages/dashboards/route.test.ts: The added case returns an empty canned snapshot and asserts internal capability call arguments; remove this standalone mock-call case and fold the selected-agent input into the existing loader regression while proving actual two-agent rows at the gallery boundary.
  • Missing end-to-end proof: Supply a real-Gateway browser scenario showing both agents’ dashboards before and after sidebar selection changes, with the sidebar catalog still scoped.
Agent review details

How this fits together

The Control UI route loader and mounted gallery consume the shared session-list capability; its Gateway queries supply dashboard rows for filtering, pagination, previews, and navigation.

flowchart LR
  A[Sidebar agent selection] --> B[Sidebar dashboard catalog]
  C[Gallery route and page] --> D[Shared session capability]
  B --> D
  D --> E[Gateway sessions list]
  E --> F[Accessible dashboard rows]
  F --> C
Loading

Technical review

Best possible solution:

Make gallery scope explicit using the existing agent selector, unless the feature owner approves an independent all-agent gallery.

Do we have a high-confidence way to reproduce the issue?

Current-main query construction and Gateway agent filtering explain the reported two-agent omission; the contributor also supplies focused red/green test output, but this review ran no reproduction.

Is this the best way to solve the issue?

For an approved independent gallery, removing agent scope in both query producers and deleting the obsolete subscription is the smallest complete implementation using existing owners; exposing the existing selector preserves the established scope contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 54def34074cc.

Provenance checked

  • Gallery route agent scope changes intended behavior with a stated reason (8b66fc1: The initial dashboard index deliberately constructed its request and loader identity from shared agent selection; its description emphasized server-side filtering and dashboard discovery.)
  • Mounted gallery source replacement changes intended behavior with a stated reason (7a494ba: The lifecycle refactor kept one projection and replaced its source from the existing selection owner while preserving behavior; the PR explains removing that coupling to make discovery independent.)
  • Gallery lifecycle regression assertions keeps the original intent (d8a6c85: The prior test consolidation retained lifecycle and recovery contracts; this PR updates the scoped-query expectation while retaining error, stale-route, pagination, and disposal coverage.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

PR surface

Source -8, Tests +34. Total +26 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 5 13 -8
Tests 2 49 15 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 54 28 +26

Labels

Label changes:

  • add P2: Hidden agent filtering impairs dashboard discovery, while dashboards remain accessible through their owning sessions and direct links.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: Hidden agent filtering impairs dashboard discovery, while dashboards remain accessible through their owning sessions and direct links.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Demonstrate the selected scope behavior through the real browser and Gateway.
  • Replace the added mock-call-only case with observable two-agent gallery coverage.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 11:56 AM ET / 15:56 UTC.

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

Closing with a handoff summary

The defect is real and the red/green evidence in the body stands, but the fix changes behavior that was deliberately designed, so it needs an owner decision this PR cannot supply. Closing rather than carrying an open product question.

Root cause (so nobody has to re-derive it)

/dashboards scopes its listing to the sidebar-selected agent. That scope is original intent, not a regression:

So the two-agent omission reported in #188449 is the established contract working as designed, not a broken contract. The only counter-evidence is page copy — docs/web/dashboards.md ("browse dashboard-enabled threads as a card gallery") and the All authors filter label — neither of which names an agent boundary.

Evidence that is still valid

  • RED on current main 4be8aab577a (production files + candidate tests only): the page re-subscribed to the selected agent's list, and the loader forwarded agentId: "finance-agent".
  • GREEN on candidate 132d6202458: 9/9 across route.test.ts + dashboards-page.test.tsx, with the other 7 cases passing on both trees.
  • Proof tier: producer-chain / owner-test. Not shipped-run.

Recommended direction

The review's recommendation is better than this PR and I agree with it: keep the existing query ownership and make the scope visible — expose the shared agent selector with an All agents option on the gallery, so users can see and change the restriction instead of the gallery silently inheriting it. That fixes the discoverability complaint in #188449 without silently reversing a design decision, and it does not require touching dashboardSessionListQuery's two consumers.

If a maintainer instead decides the gallery should always span agents, the minimal complete change is what this branch does — drop agentId from both producers (route.ts loader and dashboards-page.tsx source) and delete the now-dead agentSelection subscription — plus a real-Gateway browser scenario covering both agents' boards and the unchanged sidebar catalog.

What is not settled

  • Whether the gallery should be cross-agent at all (owner decision).
  • No shipped-run proof was produced; the browser scenario on a two-agent install was not run.

Branch fix/dashboards-gallery-agent-scope (head 132d6202458) is left in place for reference and can be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dashboards gallery only lists the currently selected agent's boards

1 participant