Skip to content

Dashboard card still stuck on 'not yet checked' after #7594: /compliance takes 22–30 s for an 84-storyboard agent, client aborts at 15 s #7630

Description

@idemidenko

Summary

Follow-up to #7578 (closed by #7594). Bugs 2 and 3 from that issue are fixed on the deployed build, but bug 1 still reproduces: GET /api/registry/agents/{url}/compliance takes 22–30 s for https://sales-agent.elementaltv.io/mcp (84 storyboards), the dashboard's FETCH_TIMEOUT_MS = 15_000 fires first, and the card for a verified agent stays in its skeleton state (not yet checked, the OAuth connect form, No badges yet, "Test your agent"). Reported as a comment on #7578 first (#7578 (comment)); filing separately since that issue is closed.

Reproduction (2026-09-21 ~10:30Z, all HTTP 200)

endpoint time
/compliance (org API key) 30.1 s, 22.4 s, 28.9 s
/compliance (anonymous) 22.1 s
/storyboard-status 29.4 s
/compliance/history?limit=10 0.6 s

The deployed build is post-#7594: the /compliance response carries refresh_availability with code: refresh_authorization_provenance_required.

Why the #7594 change did not move the number

#7594 added includeDiagnostics: false to the card-level getStoryboardStatuses call (registry-api.ts /compliance handler) and gates the agent_compliance_step_diagnostics LATERAL join on it (compliance-db.ts getStoryboardStatuses). But:

  • /compliance (join removed) and /storyboard-status (join still present, default includeDiagnostics) take the same 22–30 s, so the diagnostics join was not the dominant cost.
  • /compliance/history on the same agent is sub-second.

What the two slow routes still share is the latest_run CTE (agent_compliance_runs … ORDER BY tested_at DESC LIMIT 1) plus the correlated EXISTS (SELECT 1 FROM agent_storyboard_status latest WHERE latest.agent_url = $1 AND latest.run_id = …) predicates, evaluated per storyboard row, and getComplianceStatusWithStoryboardCounts runs the same shape once more. I have no access to EXPLAIN on the hosted DB, so this is a pointer, not a diagnosis; an index on agent_storyboard_status (agent_url, run_id) and agent_compliance_runs (agent_url, tested_at DESC) WHERE dry_run = false AND is_authoritative = true would be the first things to check.

Impact

For agents with large storyboard sets the card never hydrates, so the hydrated-only action row never renders. That includes "Requeue comply", which the new fence notice names as the alternative action, so the notice points at a control the affected owners cannot reach. The only thing that renders is the disabled "Recheck paused" button plus the notice, after one click.

Ask

Bring /compliance under the 15 s client budget for agents with ~80+ storyboards (or let the card render its action row from the fast /compliance/history + /auth-status data while /compliance is still in flight).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    admin-toolInternal tools for AAO staffbugSomething isn't workingclaude-triagedIssue has been triaged by the Claude Code triage routine. Remove to re-triage.compliance-suitepriority:P0Immediate priority: user/revenue/security/reliability bug to work nowseverity:critical

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions