Skip to content

[Bug]: Control UI can show stale approval resolve errors on the wrong prompt #98392

Description

@haruaiclone-droid

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

A failed Control UI approval resolve can display its error on a different approval if a newer approval becomes active or the gateway reconnects while the original resolve RPC is still in flight.

Steps to reproduce

  1. Open the Control UI with one pending exec approval.
  2. Click an approval decision so exec.approval.resolve starts but does not settle immediately.
  3. Before that resolve request fails, either queue a newer approval so it becomes the active prompt or reconnect the Control UI so the gateway client is replaced.
  4. Let the original resolve request fail, for example with gateway unavailable or gateway client stopped.

Expected behavior

The stale failure from the older resolve attempt should be ignored unless the same approval is still the active approval on the same gateway client.

Actual behavior

The stale failure can be written into the global execApprovalError, so the currently active approval prompt can show an error that belongs to an older approval or an old gateway client.

OpenClaw version

main branch at 21d1e1f (source checkout), package version 2026.6.11

Operating system

Windows 11 source checkout; behavior is in the browser Control UI code path.

Install method

Source checkout with pnpm.

Model

N/A - Control UI approval queue behavior.

Provider / routing chain

N/A - Control UI approval queue behavior.

Additional provider/model setup details

N/A

Logs

Focused repro coverage added locally:
- stale resolve error is ignored when a newer approval becomes active
- stopped-client resolve error is ignored after reconnect swaps clients

Screenshots, recordings, and evidence

Local validation:

  • corepack pnpm exec vitest run --config vitest.config.ts --project unit src/ui/app.exec-approval.test.ts --reporter=verbose
  • corepack pnpm exec vitest run --config vitest.config.ts --project unit src/ui/app.exec-approval.test.ts src/ui/views/exec-approval.test.ts --reporter=verbose
  • git diff --check
  • corepack pnpm ui:build

Impact and severity

Affected: Control UI users resolving exec/plugin approvals while approval events or reconnects happen concurrently.
Severity: Medium; the approval queue remains available, but the visible error can be misleading and attached to the wrong approval prompt.
Frequency: Reproducible when a resolve RPC fails after the active approval or gateway client has changed.
Consequence: Operators can see an incorrect failure on the active approval, making them retry or deny the wrong action.

Additional information

This is distinct from #98379. That issue covers the approval modal closing when a queued approval remains; this issue covers stale resolve errors being applied to the wrong visible approval prompt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions