From ad89d0a159d7a9ef355aaadab1573510664cfb4b Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Mon, 11 May 2026 05:00:11 -0400 Subject: [PATCH] fix(dashboard): drop unfiltered /api/storyboards fallback (closes #4254) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When /api/registry/agents/:url/applicable-storyboards returned a generic error — capabilities probe failure for any reason other than the recognized OAuth / needs-auth / unknown-specialism shapes — the dashboard fell back to /api/storyboards (the FULL unfiltered storyboard catalog). So a signals-only agent rendered pagination-creative-formats, get-media-buys-pagination-integrity, collection-lists-pagination- integrity, and the rest, even though none of those are applicable. That's misleading: without the agent's declared protocols + specialisms, we have no basis for showing any storyboard list. The applicable- storyboards endpoint's own filter (via resolveStoryboardsForCapabilities) is the only correct surface; falling back to the unfiltered catalog defeats it. Fix: remove the fallback. Keep the error message, suffix it with a pointer to the underlying contract (get_adcp_capabilities must return supported_protocols + specialisms before applicable storyboards can be computed). OAuth / needs-auth / unknown-specialism error paths unchanged — those still surface their respective actionable UIs. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...shboard-applicable-storyboards-fallback.md | 4 +++ server/public/dashboard-agents.html | 35 ++++++------------- 2 files changed, 14 insertions(+), 25 deletions(-) create mode 100644 .changeset/fix-dashboard-applicable-storyboards-fallback.md diff --git a/.changeset/fix-dashboard-applicable-storyboards-fallback.md b/.changeset/fix-dashboard-applicable-storyboards-fallback.md new file mode 100644 index 0000000000..76e4c661ed --- /dev/null +++ b/.changeset/fix-dashboard-applicable-storyboards-fallback.md @@ -0,0 +1,4 @@ +--- +--- + +Drops the unfiltered `/api/storyboards` fallback on the dashboard's storyboard picker. When `/api/registry/agents/:url/applicable-storyboards` returned a generic error (capabilities probe failed for a reason other than the recognized OAuth / needs-auth / unknown-specialism shapes), the dashboard fell back to the unfiltered full storyboard catalog — so a signals-only agent showed pagination-creative-formats, get-media-buys-pagination-integrity, and the rest. Closes #4254. Now: error message stays, but no storyboards render until the agent's `get_adcp_capabilities` returns `supported_protocols` and `specialisms`. OAuth / needs-auth / unknown-specialism error paths are unchanged. diff --git a/server/public/dashboard-agents.html b/server/public/dashboard-agents.html index 810869c513..2af2857cac 100644 --- a/server/public/dashboard-agents.html +++ b/server/public/dashboard-agents.html @@ -3022,35 +3022,20 @@

Agents

return; } + // Capability probe failed for an unclassified reason. We deliberately + // do NOT fall back to the unfiltered storyboard catalog here: without + // the agent's declared protocols + specialisms, every storyboard we + // could show is misleading (the agent may not even implement most of + // them). Issue #4254 — signals-only agent was seeing pagination- + // creative-formats etc. because of that fallback. const reasonText = errBody.reason ? ' (' + errBody.reason + ')' : ''; const msg = errBody.error || ('HTTP ' + res.status); - let html = '
'; + let html = '
'; html += 'Could not probe agent capabilities. ' + escapeHtml(String(msg) + reasonText); + html += '
'; + html += 'Once get_adcp_capabilities responds with supported_protocols and specialisms, applicable storyboards will appear here.'; + html += '
'; 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 += '
'; - } - } - } catch (fallbackErr) { - console.error('Storyboard fallback failed:', fallbackErr); - } - panel.innerHTML = html; } catch (err) { console.error('Failed to load storyboards:', err);