Skip to content

fix(ui): show one loading state in the agent switcher - #3237

Open
vedantlavale wants to merge 1 commit into
kagent-dev:mainfrom
vedantlavale:fix/3217-agent-switcher-loading
Open

vedantlavale wants to merge 1 commit into
kagent-dev:mainfrom
vedantlavale:fix/3217-agent-switcher-loading

Conversation

@vedantlavale

Copy link
Copy Markdown
Contributor

Closes #3217

What changed

The agent switcher fired its agents read with an empty namespace list while namespaces were still loading, so the panel first claimed the cluster had no other agents, then went blank, then listed them. It now holds the read until namespaces arrive and shows one loading placeholder until both reads land. A failed read reports an error instead of an empty cluster.

How it was tested

  • yarn vitest run src/components/agent/AgentSwitcher.test.tsx — 7 passed.
  • yarn typecheck — passed.
  • yarn lint — 0 errors (6 pre-existing warnings).
  • git diff --check — passed.
  • Both shots captured from the mock UI (?mock=slow) on the same chat route, mid-load: base at 1eb89fb1, this branch.

Before and after

Before After
Before: switcher reports no other agents while still loading After: switcher shows loading placeholders while still loading

Risks and follow-ups

UI-only change. No API, persistence, or conversation lifecycle impact.

Hold the agents read until namespaces are known, combine both reads
into one loading state, and report failures as errors instead of an
empty cluster.

Closes kagent-dev#3217

Signed-off-by: vedantlavale <vedantlavale@gmail.com>
@github-actions github-actions Bot added the bug Something isn't working label Oct 16, 2026
@vedantlavale

vedantlavale commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author
Inital (Loading) State Final List
file-2a4d0a381090d11c8b71a690ddad99e7 file-eb015a8666c3b9b129ae272bb83d65b6

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Agent switcher appears empty before agents finish loading

1 participant