fix(web): persist 'ask to fix' CI button based on live GitHub CI data#694
Open
i-trytoohard wants to merge 3 commits intomainfrom
Open
fix(web): persist 'ask to fix' CI button based on live GitHub CI data#694i-trytoohard wants to merge 3 commits intomainfrom
i-trytoohard wants to merge 3 commits intomainfrom
Conversation
Previously, the CI failure 'ask to fix' button only appeared when the PR's enriched ciStatus was "failing" — which requires a full /api/sessions refresh (up to 15s). The SSE snapshot updates session.status to "ci_failed" in ~5s, but that wasn't being used to show the button. Now getAlerts() checks both session.status === "ci_failed" (SSE-updated, real-time) and pr.ciStatus === CI_STATUS.FAILING (enrichment-based), so the button appears as soon as the SSE snapshot reflects the CI failure and persists for the entire ci_failed state — even before PR data is enriched. When session.status is ci_failed but no specific check details are available yet (ciChecks empty), show "CI failing" + "ask to fix" rather than the non-actionable "CI unknown" label. Closes #590 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…st-server All 66 no-undef lint errors were caused by two missing configurations: 1. Plugin packages and CLI use Node.js globals (console, process, URL, setTimeout, clearTimeout) but the ESLint config had no globals declared for these packages — added a languageOptions.globals block covering all Node.js standard globals for packages/plugins/** and packages/cli/** 2. packages/web/dist-server/** (compiled server output) was being linted as source — added it to the global ignores alongside dist/** Result: 0 errors, 18 warnings (all pre-existing no-console/non-null-assertion) Refs #590 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e pr.ciStatus The 'ask to fix' button was disappearing when the agent started working on a CI fix because session.status transitioned away from ci_failed, even though the PR still had red CI on GitHub. The button should be visible to humans whenever GitHub says CI is failing, independent of the orchestrator lifecycle. Root cause: pr.ciStatus (GitHub data) was only refreshed during full session fetches (~15s stale interval), so there was a window where the button could appear/disappear based on stale cache rather than current GitHub CI state. Fix: - SSE /api/events polling (5s) now includes pr.ciStatus and pr.ciChecks in each snapshot using cache-only PR enrichment (zero GitHub API calls — just a Map lookup into the prCache populated by /api/sessions) - useSessionEvents reducer patches pr.ciStatus/pr.ciChecks from SSE snapshots, keeping the client in sync with GitHub data every ~5 seconds - getAlerts() uses only pr.ciStatus === FAILING as the button condition — session.status is not consulted (reverts wrong approach from prior commit) - When pr.ciStatus=failing but ciChecks is empty (API inconsistency), show "CI failing" + "ask to fix" rather than the non-actionable "CI unknown", since pr.ciStatus is the authoritative GitHub signal Closes #590 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the 'ask to fix' CI failure button disappearing before users can click it.
Root cause: The button visibility was tied to
session.status === "ci_failed", which transitions away when the orchestrator auto-reacts and starts working — even though CI is still red on GitHub. The button should persist as long as GitHub reports CI as failing, independent of the orchestrator lifecycle.Changes:
/api/events/route.ts— SSE polling (every 5s) now includesprCiStatusandprCiChecksin each snapshot via cache-only PR enrichment (zero extra GitHub API calls — pure in-memory cache lookup from theprCachepopulated by/api/sessions)useSessionEvents.ts— Reducer patchespr.ciStatus/pr.ciChecksfrom SSE snapshots, keeping client CI state in sync every ~5s instead of waiting for the 15s+ stale full-refreshSessionCard.tsx(getAlerts) — Button condition ispr.ciStatus === FAILINGonly — decoupled fromsession.statusentirely. Whenpr.ciStatus=failingbutciChecksis empty (API inconsistency), shows "CI failing" + "ask to fix" sincepr.ciStatusis the authoritative GitHub signaleslint.config.js— Fixed 66 pre-existingno-undeflint errors by declaring Node.js globals for plugin/CLI packages; addeddist-server/**to ignore listTest plan
pnpm lint— 0 errors (was 66 errors pre-existing on main)pnpm typecheck— passespnpm build— passespr.ciStatus=failingregardless of session status; button hidden whenpr.ciStatus≠failingeven ifsession.status=ci_failedCloses #590
🤖 Generated with Claude Code