Repository navigation
fix(dashboard): load agent catalog on unscoped pages - #12553
Conversation
51af336 to
4e6130f
Compare
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify #12224 introduced no other strict slot-lookup 404 that the client's Suggestions
[DESIGN-REVIEWED] 8e72520 |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the added What this change shipsInventory (2 items) — 2 justifiedIntent: 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).
Provenance is derived: linked issue #12552, named regression commit, and the new parametrized case fails on base (the base handler returns 404 for [FIRST-PRINCIPLES-REVIEWED] 8e72520 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Keep the dashboard transport identity out of slot project resolution so unscoped pages can load the agent catalog.
4e6130f to
8e72520
Compare
|
cc @iamwhatever plz help take a look |
bolichen97
left a comment
There was a problem hiding this comment.
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.
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>
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>
Problem / Motivation
Opening Schedule or another agent-picker surface without a chat slot shows
Couldn't load the agent list.. These pages calluseAgents(0)without a session key, but the shared API client'sget()helper replaces that missing key withX-Session-Key: dashboard:ui.dashboard:uiidentifies the browser dashboard transport; it is not a conversation slot. The catalog handler treated every non-empty header as a real slot, splitdashboard:uitoui, failed to findstate._slots["ui"], and returned404 slot_not_found.useAgentscaught 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-onlyGET /api/agents/catalogendpoint and added strict slot-based project scoping for real chat keys. The strict lookup was correct for chat sessions, but assumed every non-emptyX-Session-Keynamed a slot. Existing non-chat callers already used thedashboard:uiplaceholder, 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
dashboard:uito the existing unscoped catalog path before slot resolutiondashboard:uito the backend regression case that already covers unscoped and empty-project requestsFixes #12552
Why tests and pipeline missed it
Noneandchat-empty), but not the browser placeholder. Both covered cases returned200, while the separate unknown-slot test correctly expected404, so the faulty classification looked intentional.useAgentstest mockedapi.agentCatalog. It correctly asserted that Schedule/Channels passundefined, but stopped before the real API client converted that value into thedashboard:uiheader.api.agentCatalogwith 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.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_crewgit diff --checkPattern 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.