diff --git a/.changeset/fix-storyboard-probe-fallback.md b/.changeset/fix-storyboard-probe-fallback.md new file mode 100644 index 0000000000..501748b1a7 --- /dev/null +++ b/.changeset/fix-storyboard-probe-fallback.md @@ -0,0 +1,4 @@ +--- +--- + +Fix storyboard probe-failure fallback in dashboard agent Test view: remove unfiltered /api/storyboards fallback that was showing all storyboards when capability discovery failed; replace with actionable per-reason guidance and handle specialism_parent_protocol_missing and 504 cases explicitly. diff --git a/server/public/dashboard-agents.html b/server/public/dashboard-agents.html index ae39c1d0a8..e73a8b0609 100644 --- a/server/public/dashboard-agents.html +++ b/server/public/dashboard-agents.html @@ -2965,35 +2965,35 @@

Agents

return; } - const reasonText = errBody.reason ? ' (' + errBody.reason + ')' : ''; - const msg = errBody.error || ('HTTP ' + res.status); - let html = '
'; - html += 'Could not probe agent capabilities. ' + escapeHtml(String(msg) + reasonText); - html += '
'; - - try { - const fallback = await fetch('/api/storyboards', { credentials: 'include' }); - if (fallback.ok) { - const fdata = await fallback.json(); - if (fdata.storyboards && fdata.storyboards.length > 0) { - html += '
Showing all available storyboards:
'; - html += '
'; - for (const sb of fdata.storyboards) { - html += '
'; - html += '
'; - html += '
' + escapeHtml(sb.title) + '
'; - html += '
' + escapeHtml(sb.summary) + '
'; - html += '
'; - html += '' + sb.step_count + ' steps'; - html += '
'; - } - html += '
'; - } + if (errBody.specialism_parent_protocol_missing) { + let html = '
'; + html += 'Capabilities misconfigured.'; + if (errBody.specialism && errBody.parent_protocol) { + html += ' Specialism ' + escapeHtml(String(errBody.specialism)) + ' requires ' + escapeHtml(String(errBody.parent_protocol)) + ' in supported_protocols.'; + html += '
Add ' + escapeHtml(String(errBody.parent_protocol)) + ' to supported_protocols in your get_adcp_capabilities response.
'; + } else { + html += ' ' + escapeHtml(String(errBody.error || 'A declared specialism is missing its required parent protocol.')); } - } catch (fallbackErr) { - console.error('Storyboard fallback failed:', fallbackErr); + html += '
'; + panel.innerHTML = html; + return; } + const reasonHints = { + network: 'Check the agent URL — the host is unreachable or DNS lookup failed.', + tls: "The agent's TLS certificate is invalid or expired.", + timeout: 'The agent did not respond in time. It may be down or slow to start.', + protocol: 'The agent responded but did not speak MCP correctly.', + }; + const msg = errBody.error || ('HTTP ' + res.status); + const hint = res.status === 504 + ? reasonHints.timeout + : (reasonHints[errBody.reason] || 'Verify the agent URL is correct and the agent is running.'); + let html = '
'; + html += 'Could not probe agent capabilities.'; + html += '
' + escapeHtml(String(msg)) + '
'; + html += '
' + escapeHtml(hint) + '
'; + html += '
'; panel.innerHTML = html; } catch (err) { console.error('Failed to load storyboards:', err);