Repository navigation
fix(ui): dismiss stale approval prompts - #86365
jesse-merhi wants to merge 1 commit into
Conversation
|
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 Root-cause cluster 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 detailsBest 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:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 9940110b881b; fix evidence: release v2026.6.9, commit 5297eebe8837. |
There was a problem hiding this comment.
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_FOUNDandAPPROVAL_ALREADY_RESOLVED(viaerr.details.reason, with message fallbacks) as terminal resolve outcomes and dismiss the active approval prompt. - Clear
execApprovalErrorwhen 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 PR egg ✨ Hatched: 🥚 common Clockwork Proofling Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
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. |
Summary
Verification
node scripts/run-vitest.mjs ui/src/ui/app.exec-approval.test.ts ui/src/ui/app-gateway.node.test.tsnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json --incremental falsepnpm exec oxfmt --check --threads=1 ui/src/ui/app.ts ui/src/ui/app.exec-approval.test.tsgit diff --checkReal behavior proof
Behavior addressed: stale approval prompts in the Control UI after the Gateway reports
APPROVAL_NOT_FOUNDorAPPROVAL_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 idandapproval 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.