[fix] Tell the user when the model catalog fails to load - #5492
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe change exposes harness catalog failure and retry atoms through workflow exports, then uses them in ChangesHarness catalog recovery
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Query
participant WorkflowAtoms
participant useModelHarness
participant User
Query->>WorkflowAtoms: Reports catalog error
WorkflowAtoms-->>useModelHarness: Provides failure state
useModelHarness-->>User: Displays unavailable alert
User->>WorkflowAtoms: Clicks Retry
WorkflowAtoms->>Query: Calls refetch()
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Railway Preview Environment
|
…egrading A null capability map has two causes: a schema with no x-ag-harness-ref (the pre-catalog controls are correct), or a catalog the browser could not reach. The drawer rendered both identically, so a failed request looked like a stale frontend build and gave the user nothing to act on. Track the query's error state and, when the schema did ask for the catalog, show a retry notice above the basic controls.
01ad2ae to
4c77704
Compare
Context
When the playground's "Model & harness" drawer cannot reach the harness catalog, it renders its pre-catalog layout: a flat single column with a plain model dropdown, no collapsible sections, no status icons. Nothing tells the user a request failed. It reads as a stale frontend build, which is exactly how it was misdiagnosed on a self-hosted deployment (the real cause was a server-side redirect, fixed in #5487).
The fallback itself is correct for one case. A schema without
x-ag-harness-refpredates the catalog, and the basic controls are the right UI for it. The problem is that a failed fetch is indistinguishable from that case: both leavecapabilitiesnull, anduseModelHarness.tsx:624branches on that single value.Changes
harnessCatalogFailedAtomexposes the catalog query's error state, andretryHarnessCatalogAtomrefetches it. The drawer now separates the two causes:When the schema asked for the catalog and the fetch failed, a warning with a Retry button appears above the controls. The pre-catalog path is untouched, so schemas that never used the catalog render exactly as before.
Tests / notes
node_modules(the web image builds in Docker), sopnpm lint-fixand the strict packagetscdid not run locally. CI is the gate here. Worth a reviewer's eye on the antdAlertusage and the write-atom signature.GET /api/workflows/catalog/harnesses/in devtools, or on any deployment carrying the redirect bug from [fix] Resolve API trailing slashes in place instead of redirecting #5487.What to QA
workflows/catalog/harnesses. A warning appears above the basic controls with a working Retry button. Retry with the block removed loads the full sectioned layout.x-ag-harness-ref. The basic controls render with no warning, unchanged.