Skip to content

fix: surface failed component list loads in expose components form - #106

Open
0717lee wants to merge 1 commit into
contextforge-org:mainfrom
0717lee:fix/expose-components-error-state
Open

fix: surface failed component list loads in expose components form#106
0717lee wants to merge 1 commit into
contextforge-org:mainfrom
0717lee:fix/expose-components-error-state

Conversation

@0717lee

@0717lee 0717lee commented Sep 5, 2026

Copy link
Copy Markdown

Closes #6549

Summary

In the expose step, the three component lists are loaded with useQuery but only data, isLoading, and refetch are destructured — error is never read. A failed /tools, /resources, or /prompts request therefore renders identically to a successful empty one: the section shows "0 tools" / "0 resources" / "0 prompt templates" and invites pressing "Expose components" on what looks like a server offering nothing.

  • Each section now reads its own query error. When a load fails, the count line shows "Failed to load …" in the app-wide error tone (via STATUS_TONE_CLASS) instead of a zero count, and the section renders an error InlineNotification with the API error message and a Retry action that refetches just that list.
  • Sections whose own request succeeded keep showing their real counts, including legitimate zeros — a connected MCP server that exposes no tools, resources, or prompts is not an error, and must keep rendering as it does today.

Unit tests cover the failed/empty distinction, per-section independence (some sections fail while others keep their counts), and recovery through Retry.

A failed /tools, /resources, or /prompts request rendered identically
to a successful empty one: the section showed a zero count with no
error. Read the useQuery error per section, show the count line as
"Failed to load ..." with an error notification and a retry action,
and keep real counts (including legitimate zeros) for sections whose
request succeeded.

Signed-off-by: Li Fengmin <2080291162@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][UI-REWRITE]: Expose components step shows 0 counts when the component lists fail to load

1 participant