Skip to content

feat(seer): Poll live autofix run status on overview - #122191

Open
NicoHinderling wants to merge 1 commit into
feat/seer-autofix-overview-status-expandfrom
feat/seer-autofix-overview-status-frontend
Open

feat(seer): Poll live autofix run status on overview#122191
NicoHinderling wants to merge 1 commit into
feat/seer-autofix-overview-status-expandfrom
feat/seer-autofix-overview-status-frontend

Conversation

@NicoHinderling

Copy link
Copy Markdown
Contributor

Polls live Autofix run status on the overview page so cards show a "Working…" spinner while a run is actively processing, and so a card moves sections (e.g. a PR merged directly on GitHub → "Merged") within ~10s — even when no run is running.

How

  • The overview hook now runs a light expand=status poll every POLL_INTERVAL (10s), alongside the enriched (scmInfo/issueStats/status) request. The poll pauses when the tab is hidden.
  • Each poll overlays the freshest per-run status onto the rendered cards (by seerRunId), so spinners update without re-fetching enrichment.
  • A (seerRunId, milestone) section signature is computed from each poll; when it changes (a run moved section, or appeared/disappeared) the enriched request is silently refetched, so badges/counts and bucketing stay consistent.
  • OverviewAction renders a Working… spinner when a run's status is processing.

Notes

  • Stacked on the backend PR feat(seer): Add status expand for live autofix run status #122190 (status expand) and blocked on that backend deploying — the poll is a no-op (status: null) until the endpoint ships.
  • Out of scope: live "checks passed"/"approved" badges — those are GitHub-sourced enrichment and need their own webhook mechanism, independent of this poll.
  • Follow-up (v2): swap the poll transport for Conduit/SSE once it is production-ready, keeping polling as the fallback.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 18, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 94.36% 94.36% ±0%
Typed 134,610 134,637 🟢 +27
Untyped 8,047 8,048 🔴 +1
🔍 1 new type safety issue introduced

Type assertions (as) (1 new)

File Line Detail
static/app/views/seerWorkflows/overview/useAutofixOverview.ts 67 as AutofixOverviewResponse['runsByMilestone']Object.fromEntries( Object.entries(base.runsByMilestone).map(([milestone, runs]…

This is informational only and does not block the PR.

@NicoHinderling
NicoHinderling marked this pull request as ready for review August 18, 2026 04:34
Comment thread static/app/views/seerWorkflows/overview/useAutofixOverview.ts
Comment thread static/app/views/seerWorkflows/overview/useAutofixOverview.ts Outdated
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-status-expand branch from 87ecd86 to 7c2d84f Compare August 18, 2026 05:19
@NicoHinderling
NicoHinderling requested a review from a team as a code owner August 18, 2026 05:19
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-status-frontend branch from f19eb51 to 459b433 Compare August 18, 2026 05:19
@NicoHinderling
NicoHinderling force-pushed the feat/seer-autofix-overview-status-frontend branch from 459b433 to 9075548 Compare August 18, 2026 05:24
const source = enrichedQuery.data ?? statusPollQuery.data;
const data = useMemo(
() => (source ? overlayStatus(source, statusPollQuery.data) : undefined),
[source, statusPollQuery.data]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale poll status overwrites newer data

Medium Severity

overlayStatus always prefers the status-poll payload over enrichment, but both queries request status and can finish out of order. A slower or earlier poll can overwrite a newer enriched status, so the Working spinner can linger or reappear until the next poll even after a run has already completed.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9075548. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferring this one — it's a brief, self-healing case: if an enriched refetch lands with a newer status than the last 10s poll, the poll can revert it until the next poll corrects it (≤10s). Fixing it properly needs a per-run freshness marker (a timestamp/version) that neither this endpoint nor Seer exposes today, so it belongs with the planned v2 work (push/SSE + versioning) rather than this PR.

Comment thread static/app/views/seerWorkflows/overview/useAutofixOverview.ts Outdated
Comment on lines +149 to +158
if (status === 'processing') {
return (
<Flex align="center" gap="xs">
<LoadingIndicator mini />
<Text size="sm" variant="muted">
{t('Working…')}
</Text>
</Flex>
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The component may incorrectly show a loading spinner for a merged run if its status is 'processing', because the status check happens before the section-specific logic for 'merged' runs.
Severity: LOW

Suggested Fix

Reorder the conditional logic. Check if sectionKey === 'merged' first, and render the merged UI. Then, in a subsequent else if, check for status === 'processing' to show the spinner for other sections. This ensures the 'merged' state always takes precedence over the 'processing' state.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/seerWorkflows/overview/issueCard.tsx#L149-L158

Potential issue: The component's logic prioritizes showing a loading spinner for any run
with `status === 'processing'`. This check occurs before the logic that handles runs in
the 'merged' section. If a backend state inconsistency were to cause a run to be in the
'merged' section while still having a 'processing' status, the UI would incorrectly
display a loading spinner instead of the expected UI for a merged pull request. While
the backend is designed to prevent this state, the frontend does not defensively handle
this possibility.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferring this one: a run only appears in the Merged section after its PR is merged, and by then Seer's run has finished — so a merged run is never processing, and the spinner can't show here. Since the merged-and-still-processing case can't actually happen, the check order doesn't produce a wrong spinner in practice.

Poll the overview endpoint with expand=status every 10s (paused when the
tab is hidden) alongside the enriched request, and overlay the freshest
per-run status onto the cards so a run actively working shows a "Working…"
spinner. A section signature computed from each poll refetches enrichment
only when a run changes section, and a best-effort poll that returns null
never clobbers a status already known.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit de70d94. Configure here.

Comment thread static/app/views/seerWorkflows/overview/useAutofixOverview.ts
@linear-code

linear-code Bot commented Aug 18, 2026

Copy link
Copy Markdown

AIML-3342

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

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant