Skip to content

fix(ui): dismiss stale approval prompts - #86365

Closed
jesse-merhi wants to merge 1 commit into
mainfrom
jesse/dismiss-stale-approval-prompts
Closed

jesse-merhi wants to merge 1 commit into
mainfrom
jesse/dismiss-stale-approval-prompts

Conversation

@jesse-merhi

Copy link
Copy Markdown
Member

Summary

  • Dismiss Control UI approval prompts when the Gateway says the approval was already resolved or expired.
  • Keep the prompt visible for non-terminal resolve failures, such as a disconnected Gateway.
  • Add jsdom coverage for expired, already-resolved, and real failure cases.

Verification

  • node scripts/run-vitest.mjs ui/src/ui/app.exec-approval.test.ts ui/src/ui/app-gateway.node.test.ts
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json --incremental false
  • pnpm exec oxfmt --check --threads=1 ui/src/ui/app.ts ui/src/ui/app.exec-approval.test.ts
  • git diff --check

Real behavior proof

Behavior addressed: stale approval prompts in the Control UI after the Gateway reports APPROVAL_NOT_FOUND or APPROVAL_ALREADY_RESOLVED.

Real environment tested: local OpenClaw UI test environment in a clean worktree.

Exact steps or command run after this patch: node scripts/run-vitest.mjs ui/src/ui/app.exec-approval.test.ts ui/src/ui/app-gateway.node.test.ts.

Evidence after fix: the new tests simulate unknown or expired approval id and approval already resolved, then assert the active approval is removed and no error remains.

Observed result after fix: 2 test files passed, 54 tests passed.

What was not tested: manual browser clicking against a live stale modal; the behavior is covered with direct handler tests and existing gateway queue tests.

Copilot AI review requested due to automatic review settings May 25, 2026 07:04
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open for protected maintainer handling: the branch is substantively superseded by the merged current-main fix in #86270, but this PR is MEMBER-authored and has the protected maintainer label.

Root-cause cluster
Relationship: superseded
Canonical: #86270
Summary: This PR and the merged related PR target the same stale Control UI approval prompt behavior; the merged PR is the canonical implementation now present on current main and in the latest available release tag.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this PR as superseded by #86270.

So I’m closing this here and keeping the remaining discussion on #86270.

Review details

Best possible solution:

Close this PR as superseded by #86270.

Do we have a high-confidence way to reproduce the issue?

No current-main reproduction remains from source inspection: current main and the latest available release tag already contain stale approval dismissal and refresh handling. The original failure path was proven in the merged related PR, not rerun live here.

Is this the best way to solve the issue?

No. This was a plausible narrow fix when opened, but the best current solution is the already-merged controller-owned implementation with pending-list refresh, race handling, and broader coverage.

Security review:

Security review cleared: The diff only changes Control UI approval state handling and a colocated test file; no dependency, workflow, credential, package, or code-execution surface changes were found.

AGENTS.md: found and applied where relevant.

What I checked:

  • linked superseding PR: Fix stale approval prompts in Control UI #86270 (Fix stale approval prompts in Control UI) is merged at 2026-05-27T03:38:53Z.
  • cluster evidence: the durable review links that PR in the work cluster or recommended risk path.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • jesse-merhi: Authored this PR and also authored/merged the broader stale approval cleanup in the canonical merged PR now reflected in current main. (role: superseding fix author and merger; confidence: high; commits: 142466d002d7, 5297eebe8837, ac9331621679; files: ui/src/ui/app.ts, ui/src/ui/controllers/exec-approval.ts, ui/src/ui/app.exec-approval.test.ts)
  • Peter Steinberger: Git history for the same approval UI area includes the gateway-routed exec approval feature, making this a useful adjacent ownership signal for approval UI behavior. (role: introduced adjacent approval UI behavior; confidence: medium; commits: 87343c374e6a; files: ui/src/ui/app.ts, ui/src/ui/app-gateway.ts, ui/src/ui/views/exec-approval.ts)
  • Vincent Koc: The current shallow/grafted checkout blames the touched approval UI lines to a recent broad main commit, so this is a weak routing signal rather than feature authorship proof. (role: recent area contributor signal from current shallow history; confidence: low; commits: af3e509ab823; files: ui/src/ui/app.ts, ui/src/ui/controllers/exec-approval.ts)

Codex review notes: model internal, reasoning high; reviewed against 9940110b881b; fix evidence: release v2026.6.9, commit 5297eebe8837.

Copilot AI 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.

Pull request overview

This PR updates the Control UI’s exec-approval resolution flow to automatically dismiss “stale” approval prompts when the Gateway reports the approval is already resolved or no longer exists (expired/unknown), while keeping prompts visible for non-terminal failures (e.g., disconnected Gateway). It also adds jsdom tests to cover the terminal vs non-terminal behaviors.

Changes:

  • Treat APPROVAL_NOT_FOUND and APPROVAL_ALREADY_RESOLVED (via err.details.reason, with message fallbacks) as terminal resolve outcomes and dismiss the active approval prompt.
  • Clear execApprovalError when dismissing a stale approval so the UI doesn’t show an error for already-resolved/expired prompts.
  • Add jsdom coverage for expired, already-resolved, and genuine failure cases around handleExecApprovalDecision.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ui/src/ui/app.ts Adds terminal-error detection for stale approvals and dismisses the active approval prompt on those outcomes.
ui/src/ui/app.exec-approval.test.ts Adds jsdom tests validating dismissal for terminal approval-resolve errors and retention for non-terminal errors.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Clockwork Proofling

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: guards the happy path.
Image traits: location proof lagoon; accessory green check lantern; palette seafoam, black, and opal; mood focused; pose balancing on a branch marker; shell soft velvet shell; lighting golden review-room light; background little resolved-comment flags.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Clockwork Proofling in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. P2 Normal backlog priority with limited blast radius. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 25, 2026
@jesse-merhi jesse-merhi self-assigned this May 25, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 19, 2026
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thanks @jesse-merhi. Closing this branch as superseded by #86270, which landed the broader stale-approval cleanup in 5297eeb. This head now conflicts with current main and has no remaining unique change to land.

@steipete steipete closed this Jul 9, 2026
@shakkernerd
shakkernerd deleted the jesse/dismiss-stale-approval-prompts branch October 19, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants