Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/fix-dashboard-applicable-storyboards-fallback.md
Original file line number Diff line number Diff line change
@@ -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.
35 changes: 10 additions & 25 deletions server/public/dashboard-agents.html
Original file line number Diff line number Diff line change
Expand Up @@ -3022,35 +3022,20 @@ <h1>Agents</h1>
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 = '<div style="padding:var(--space-3);background:var(--color-error-50);border:1px solid var(--color-error-200);border-radius:var(--radius-md);color:var(--color-error-700);font-size:var(--text-sm);margin-bottom:var(--space-3);">';
let html = '<div style="padding:var(--space-3);background:var(--color-error-50);border:1px solid var(--color-error-200);border-radius:var(--radius-md);color:var(--color-error-700);font-size:var(--text-sm);">';
html += '<strong>Could not probe agent capabilities.</strong> ' + escapeHtml(String(msg) + reasonText);
html += '<div style="margin-top:var(--space-2);font-size:var(--text-xs);color:var(--color-error-600);">';
html += 'Once <code>get_adcp_capabilities</code> responds with <code>supported_protocols</code> and <code>specialisms</code>, applicable storyboards will appear here.';
html += '</div>';
html += '</div>';

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 += '<div style="font-size:var(--text-xs);color:var(--color-text-secondary);margin-bottom:var(--space-2);">Showing all available storyboards:</div>';
html += '<div class="storyboard-picker">';
for (const sb of fdata.storyboards) {
html += '<div class="storyboard-picker-item" data-storyboard-id="' + escapeHtml(sb.id) + '" data-agent-url="' + escapeHtml(agentUrl) + '" data-card-id="' + escapeHtml(cardId) + '">';
html += '<div>';
html += '<div class="storyboard-picker-title">' + escapeHtml(sb.title) + '</div>';
html += '<div class="storyboard-picker-summary">' + escapeHtml(sb.summary) + '</div>';
html += '</div>';
html += '<span style="font-size:var(--text-xs);color:var(--color-text-tertiary);">' + sb.step_count + ' steps</span>';
html += '</div>';
}
html += '</div>';
}
}
} catch (fallbackErr) {
console.error('Storyboard fallback failed:', fallbackErr);
}

panel.innerHTML = html;
} catch (err) {
console.error('Failed to load storyboards:', err);
Expand Down
Loading