Skip to content

fix(dashboard): load agent catalog on unscoped pages - #12553

Merged
bolichen97 merged 1 commit into
kirodotdev:mainfrom
yurenji:renji/fix-schedule-agent-catalog
Sep 22, 2026
Merged

bolichen97 merged 1 commit into
kirodotdev:mainfrom
yurenji:renji/fix-schedule-agent-catalog

Conversation

@yurenji

@yurenji yurenji commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Opening Schedule or another agent-picker surface without a chat slot shows Couldn't load the agent list.. These pages call useAgents(0) without a session key, but the shared API client's get() helper replaces that missing key with X-Session-Key: dashboard:ui.

dashboard:ui identifies the browser dashboard transport; it is not a conversation slot. The catalog handler treated every non-empty header as a real slot, split dashboard:ui to ui, failed to find state._slots["ui"], and returned 404 slot_not_found. useAgents caught the rejection and exposed the generic roster error rendered by Schedule.

The regression came from #12224, merged as 02a77624b4aa3f208e762a0aa2267b78a65b4bbf. That change replaced the picker’s config-writing sync/list flow with the read-only GET /api/agents/catalog endpoint and added strict slot-based project scoping for real chat keys. The strict lookup was correct for chat sessions, but assumed every non-empty X-Session-Key named a slot. Existing non-chat callers already used the dashboard:ui placeholder, so the two established contracts disagreed at their new boundary.

Why it matters

Schedule, Channels, Projects, and other non-chat roster consumers use the catalog without owning a chat slot. Treating their dashboard transport identity as a missing conversation makes the agent selector unavailable even though the configured roster is healthy. Users cannot select an agent for scheduled work, and Retry deterministically repeats the same 404.

What changed

  • normalize only dashboard:ui to the existing unscoped catalog path before slot resolution
  • keep strict project scoping and cross-app access checks for every real chat session key
  • add dashboard:ui to the backend regression case that already covers unscoped and empty-project requests

Fixes #12552

Why tests and pipeline missed it

  • The backend catalog test covered a genuinely absent header and a real empty-project slot (None and chat-empty), but not the browser placeholder. Both covered cases returned 200, while the separate unknown-slot test correctly expected 404, so the faulty classification looked intentional.
  • The useAgents test mocked api.agentCatalog. It correctly asserted that Schedule/Channels pass undefined, but stopped before the real API client converted that value into the dashboard:ui header.
  • SchedulePage tests also mock api.agentCatalog with resolved or rejected promises. They validate roster error and retry UI rather than the request header/backend response, so the production rejection exercised an expected UI path.
  • Frontend and backend suites validated their sides independently. No integration/E2E test sent the real client's default header through the real catalog handler on a non-chat page. Manual verification for feat: pick installed templates in chat without enrolling crew members #12224 focused on the chat picker, where a real slot key is present.

Existing API-client tests already pin that missing session context becomes dashboard:ui; this PR adds the matching backend contract so both sides now agree on the placeholder's meaning.

Tests

  • .venv/bin/python -m pytest -q test/test_agent_execution_catalog.py (15 passed)
  • .venv/bin/python -m black --check --target-version py310 src/kiro_crew/dashboard/handlers/agent_catalog.py test/test_agent_execution_catalog.py
  • .venv/bin/python -m isort --check-only src/kiro_crew/dashboard/handlers/agent_catalog.py test/test_agent_execution_catalog.py
  • .venv/bin/python -m flake8 src/kiro_crew/dashboard/handlers/agent_catalog.py test/test_agent_execution_catalog.py
  • .venv/bin/python -m mypy --platform linux src/kiro_crew
  • git diff --check
  • rebuilt and installed the macOS arm64 desktop app; verified the Schedule page loads without the agent-list error

Pattern harvest

Rule candidate: boundary-contract test
Pattern: Shared client sentinel headers must be normalized at the server boundary and covered by a real client-to-handler contract test before generic resource lookup.

@yurenji
yurenji requested a review from a team September 21, 2026 15:37
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Sep 21, 2026
@yurenji
yurenji force-pushed the renji/fix-schedule-agent-catalog branch from 51af336 to 4e6130f Compare September 21, 2026 15:44
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of 8e72520fd96b504171aa6b966d174172846fdd97 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify #12224 introduced no other strict slot-lookup 404 that the client's dashboard:ui placeholder can still reach — this PR normalizes only the catalog handler.

Suggestions

  • The literal "dashboard:ui" now carries slot-vs-transport meaning in a handler while feature_videos_manifest.DASHBOARD_SURFACE_KEY already names it; a shared constant or a _shared.py helper ("session key that names a slot, or empty") would stop the next strict-slot handler from re-learning fix(dashboard): load agent catalog on unscoped pages #12552.

[DESIGN-REVIEWED] 8e72520

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — ✅ PASS

Premise-level review of 8e72520fd96b504171aa6b966d174172846fdd97 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Verify the added dashboard:ui parametrize case actually 404s on base — it is the only regression pin distinguishing this fix from a no-op.

What this change ships

Inventory (2 items) — 2 justified

Intent: FIX — make the agent picker load on non-chat pages (Schedule, Channels, Projects), where the browser's placeholder session key was misread as a missing conversation (issue #12552, regression from #12224).

  1. Opening Schedule or another non-chat page now shows the agent list instead of "Couldn't load the agent list." — justified
  2. The backend catalog regression test now also covers the browser's placeholder session key — justified

Provenance is derived: linked issue #12552, named regression commit, and the new parametrized case fails on base (the base handler returns 404 for dashboard:ui). The fix sits at mechanism level — it edits the exact classification #12224 introduced, and keeps strict slot scoping for real chat keys. No shared normalizer exists to reuse: I grepped dashboard:ui in src/kiro_crew and the fold is an established per-handler idiom (7 existing fold sites across token_auth.py, _shared.py, cron.py, prompts.py, artifacts.py); every existing header-reading sibling already handles the placeholder, so this was the one unfixed instance, not a point patch among misbehaving siblings. No pins deleted; no defaults, surface, or riders ship.

[FIRST-PRINCIPLES-REVIEWED] 8e72520

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed 8e72520fd96b504171aa6b966d174172846fdd97 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 8e72520

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 8e72520fd96b504171aa6b966d174172846fdd97 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 8e72520

Keep the dashboard transport identity out of slot project resolution so unscoped pages can load the agent catalog.
@yurenji
yurenji force-pushed the renji/fix-schedule-agent-catalog branch from 4e6130f to 8e72520 Compare September 22, 2026 01:00
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 22, 2026
@yurenji

yurenji commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

cc @iamwhatever plz help take a look

@bolichen97
bolichen97 enabled auto-merge (squash) September 22, 2026 04:40

@bolichen97 bolichen97 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.

Approved after a live re-verification: readiness: passed label, PR Readiness status success on this head, no required check pending/failed/cancelled, mergeable, no effective CHANGES_REQUESTED, and no unresolved human blocking request found in comments or review threads. Native auto-merge (squash) enabled; no admin override used.

@bolichen97
bolichen97 merged commit 3987433 into kirodotdev:main Sep 22, 2026
96 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 22, 2026
@yurenji
yurenji deleted the renji/fix-schedule-agent-catalog branch September 22, 2026 04:43
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
Keep the dashboard transport identity out of slot project resolution so unscoped pages can load the agent catalog.

Co-authored-by: renji.yu <renji.yu@cloudkitchens.com>
wknight1 pushed a commit to wknight1/KiroCrew that referenced this pull request Oct 5, 2026
Keep the dashboard transport identity out of slot project resolution so unscoped pages can load the agent catalog.

Co-authored-by: renji.yu <renji.yu@cloudkitchens.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(dashboard): load agent catalog on unscoped pages

2 participants