Skip to content

fix(settings): show the arm poll notices after three failed polls - #38160

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/37084-arm-poll-notice-threshold
Nov 19, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/37084-arm-poll-notice-threshold

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The two "Couldn't refresh the approval status from the gateway" notices in Settings › About appear once three GET /api/update/arm polls in a row have failed, for any failure: a 500, a 502/503, a dropped connection or a 429.

Two notices in Settings › About wait for three failures of the arm-status poll: arm-poll-error in the armed in-app update, and agent-update-request-panel-error on an agent's update request card. With the gateway answering 500 or 503 to every read, or the link dropped, neither ever appeared. Only a 429 showed one, and it hid again at the start of every poll.

Why it matters

These notices exist for the moment the gateway stops answering while an update waits for its approval. For a 5xx or a dropped link they never appeared, so the approval could land, or the request expire, with nothing on screen saying the panel had lost track of it.

Not a goal

What changed (motivation → approach → change)

Both notices showed when React Query's failureCount reached 3. React Query restarts that count at the start of every fetch, so it only counts one poll's retries, and the dashboard's retry policy retries a failure that is not a 429 once. For a 500, a 503 or a dropped link the count stopped at 2.

The notices count whole polls instead. useArmPollFailing in pages/settings/AboutPanelUpdateFlow.tsx reads two fields React Query keeps across fetches: errorUpdateCount (one more for each poll that failed after its retries) and dataUpdatedAt (renewed by every answer, the arm click's own write included). Any answer ends the run. Both notices use it, the armed in-app update and the request card in pages/settings/AboutPanel.tsx.

Failure on every read Before After
500 / 503 / dropped link never shown about 13 s in (the third failed poll), stays up until a poll answers
429 about 4 s in, during one poll's retries, then hidden again at each new poll about 59 s in (three polls of its longer retry ladder), stays up

Backwards compatibility

Compatible: only when the two notices show changes; their wording, the threshold and the retry policy are unchanged.

Reader: website/src/pages/settings/AboutPanel.tsx:AboutPanel -- crew page -- the only importer of ARM_POLL_FAILURE_THRESHOLD, which is no longer exported; it calls useArmPollFailing instead

Tests

  • AboutPanel.agentUpdateRequest.test.tsx, a poll that keeps failing is surfaced, and the card stays up: runs on the app's own client (newQueryClient(), retry delay shortened) with a 503, where it used a retry: 3 client production does not have.
  • AboutPanel.inAppApply.test.tsx, says the approval status is unreachable after three failed polls of a 503, not before: on the app's client, arm-poll-error is absent after two failed polls of a 503 and present after the third.
  • Both fail on the base with the production hunks reverted.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Reproduced and smoke-tested on Ubuntu 24.04.5 LTS (Linux x86_64): the dashboard built from an earlier base (d15505809e) and then with this change on it, served by an isolated gateway and driven with Playwright. Only /api/update/arm was intercepted, plus, for the armed in-app update, the update_* status fields that a git checkout reports as not armable.

Every arm-status read answers Base This branch
503, request card no notice in 90 s shown at 13.1 s, up at 90 s
500, request card no notice in 90 s shown at 13.3 s, up at 90 s
503, armed in-app update no notice in 90 s shown at 13.2 s, up at 90 s
dropped connection, armed in-app update no notice in 90 s shown at 13.3 s, up at 90 s
429, armed in-app update shown at 3.6 s, hidden again 4 times shown at 58.7 s, up at 90 s

Recovery: with the notice up on the armed in-app update, the read was switched back to the live arm answer. The next poll answered, the notice was gone 0.3 s later, and the armed panel stayed.

Screenshots / video

Request card, every read answering 503, at the 90 s mark. Base, then this branch:

Request card on the base: no notice after 90 s of 503s
Request card on this branch: the notice under the request

Armed in-app update, every read answering 503. Base at 90 s, then this branch, then after the gateway answers again:

Armed panel on the base: no notice after 90 s of 503s
Armed panel on this branch: the notice under the countdown
Armed panel after the next poll answers: the notice is gone

The header's d15505809e badge names the gateway's own checkout. In the "this branch" shots the dashboard bundle is built from this branch's tree.

Related Issues

Closes #37084

Sibling sweep

Swept: git grep -nE "failureCount >=|.failureCount\b" -- website/src
Sibling: website/src/pages/settings/AboutPanel.tsx -- changed here
Sibling: website/src/pages/settings/AboutPanelUpdateFlow.tsx -- changed here
Sibling: website/src/components/PullRequestPanel.tsx:132 -- not affected -- its threshold reads the panel's own failed-poll counter, not React Query's failureCount

Pattern harvest

Rule candidate: review-prompt
Pattern: a notice or gate that waits for React Query's failureCount to pass the number of retries one fetch gets.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0d881a7050c2663c1422810762862790fc9a539e — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix counts whole failed polls at the cause: React Query restarts failureCount on every fetch, and production retries a failure that is not a 429 only once. Issue #37084 tracks the defect, and the new tests fail on the base.

What this change ships

Inventory (5 items) — 5 justified

Intent: when the gateway stops answering the arm-status poll while an update waits for approval, the user is told the panel can no longer track it. FIX.

  1. On the armed in-app update, the "couldn't refresh approval status" notice now appears after three failed polls of a 500, 503 or dropped link. Before, it never appeared — justified
  2. The same notice on an agent's update request card now appears for those failures too — justified
  3. On a 429, the notice moves from about 4 s in (and hidden again at each poll) to about 59 s in, and it stays up — justified
  4. ARM_POLL_FAILURE_THRESHOLD is no longer exported, and its only importer now calls useArmPollFailing (2 consumers) — justified
  5. The request-card test now runs on the app's own query client instead of a retry: 3 client that production does not have — justified

[FIRST-PRINCIPLES-REVIEWED] 0d881a7

Description read

[DESCRIPTION-READ] edaa6b88f072cf2e1f0de930a03cad8e7b62e88fa5c7ebe1edd694cb24b9cb11

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 0d881a7050c2663c1422810762862790fc9a539e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: counting whole failed polls fixes the actual cause, which was React Query's per-fetch failureCount. The only take-away is the ARM_POLL_FAILURE_THRESHOLD export, and its sole reader is listed.

[DESIGN-REVIEWED] 0d881a7

Description read

[DESCRIPTION-READ] ab21a2a23397ed01ca9bc5288b78a82b924ee2d5004a2644a8cba4156fb4daa8

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 0d881a7050c2663c1422810762862790fc9a539e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. This PR only changes when two existing notices appear. Their wording and controls are unchanged, and the screenshots show both before and after.

Notes

  • The blind reader saw "The countdown keeps running locally" next to an "Expires in 3 minutes" line that never changed. Across the in-app shots the timer went up instead of down (8:25 → 9:30 → 9:50). That copy predates this PR, but the PR now shows it for 5xx failures too, where it was hidden before. Either make the timer count down in front of the user, or cut the clause.
  • In the armed in-app update, no agent is involved. The blind reader asked who "Ask the agent" means: "Here no agent was involved at all, so I'd wonder who 'the agent' is." The fix is to name what the link sends and who it goes to, for example "Ask Kiro Crew to look into this". The PR's Not a goal list leaves this to About: "Ask the agent" loses the request report on three update notices worded from the catalog #33750.

[UX-REVIEWED] 0d881a7

Description read

[DESCRIPTION-READ] 1745d2f2387ddb57c42cabe85fb65de0d2d261c9348af2252adb3e045bc9af28

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 0d881a7050c2663c1422810762862790fc9a539e — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 0d881a7

Verdict parsed from the review's SHA-scoped output markers for commit 0d881a7050c2663c1422810762862790fc9a539e.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 0d881a7050c2663c1422810762862790fc9a539e false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 0d881a7050c2663c1422810762862790fc9a539e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0d881a7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 0d881a7050c2663c1422810762862790fc9a539e false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 17, 2026
Two notices in Settings > About say the approval status could not be
refreshed once the GET /api/update/arm poll keeps failing. They read
React Query's failureCount, which restarts at every fetch, and the
dashboard's retry policy retries a failure that is not a 429 once, so
for a 500, a 502/503 or a dropped link the count stopped at 2 and the
threshold of 3 was never reached.

Both notices count failed polls in a row from the query's
errorUpdateCount, restarting at every answer (dataUpdatedAt), which
carry across fetches, and show on the third.
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/pages/settings/ (the directory of this PR's files; none of the four files changed) since this head's CI ran (2c612d7 on d155058 -> 0d881a7 on 8301e68); the new base carries #38265, the fix for the test-shared-tmp-dir match in test/test_acp_node_compile_cache_engine.py that failed SAST (Semgrep) on the previous head. Same diff, one commit; CI re-running.

[operator: bolichen97]

@bolichen97
bolichen97 force-pushed the fix/37084-arm-poll-notice-threshold branch from 2c612d7 to 0d881a7 Compare November 19, 2026 15:10
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 19, 2026
@KiroCrewCaptain

KiroCrewCaptain commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

The fix is correct: React Query restarts failureCount on every fetch, and retryPolicy retries anything other than a 429 only once, so the count never reached 3 for a 5xx or a dropped link. The new useArmPollFailing hook counts whole failed polls instead, using errorUpdateCount since the last dataUpdatedAt change. Any answer resets the count, including the arm click's setQueryData seed and an arm picked up from a poll. Because a fetch starting changes neither field, the notice no longer hides at each new poll. Both consumers read the same cached query ['update-arm-status'], so they share the same counts. The removed export ARM_POLL_FAILURE_THRESHOLD had one importer, and it now uses the hook. Both tests run on the production client (newQueryClient) with a 503 and would fail without the fix. CI is green, and every automated review lane found nothing blocking.

Tier: 1, every tier gate passed.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 0d881a7050 · 80 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 19, 2026 16:15

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved automatically by the code change approver, not by a person. The decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and the change has at most 400 changed lines.

The fix is correct: React Query restarts failureCount on every fetch, and retryPolicy retries anything other than a 429 only once, so the count never reached 3 for a 5xx or a dropped link. The new useArmPollFailing hook counts whole failed polls instead, using errorUpdateCount since the last dataUpdatedAt change. Any answer resets the count, including the arm click's setQueryData seed and an arm picked up from a poll. Because a fetch starting changes neither field, the notice no longer hides at each new poll. Both consumers read the same cached query ['update-arm-status'], so they share the same counts. The removed export ARM_POLL_FAILURE_THRESHOLD had one importer, and it now uses the hook. Both tests run on the production client (newQueryClient) with a 503 and would fail without the fix. CI is green, and every automated review lane found nothing blocking.

Tier: 1, every tier gate passed.
Criteria: no merge conflict, no owner block, no change request, the default branch, no security-sensitive path, no design document to agree on, the readiness status, the review lanes, the P0 history, the linked issues' tier, the review lessons, no concern label, the file count, a safe change category, not its own change, the decider, the security checklist, the change matches its title, no competing change.

Decider v3c (217fe607). To overrule it, request changes or dismiss this review.

@KiroCrewCaptain
KiroCrewCaptain merged commit 60a1064 into main Nov 19, 2026
99 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/37084-arm-poll-notice-threshold branch November 19, 2026 16:15
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

About: the two arm-status poll notices never appear for a 5xx because the client retries it only once

2 participants