Skip to content

chore(ui): cover native approval finalization - #137259

Merged
jalehman merged 10 commits into
mainfrom
openclaw/persist-native-approval-cards-after-finalization
Sep 4, 2026
Merged

jalehman merged 10 commits into
mainfrom
openclaw/persist-native-approval-cards-after-finalization

Conversation

@jalehman

@jalehman jalehman commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Related: #137017

What Problem This Solves

Resolves a coverage gap where the default Control UI WebChat path could regress from an event-owned native approval card to duplicated fallback text during stream finalization or session hydration.

Why This Change Was Made

The production fix already keeps delegated OpenClaw tool calls pending until approval settles. This change adds a real-Gateway browser regression that locks in the ownership boundary: approval events own the actionable card, and only the settled tool result enters transcript history.

User Impact

No new user-facing behavior. This protects the shipped approval flow from losing the native card, duplicating fallback text, or dropping the settled result across reloads.

Evidence

  • Pending state shows exactly one native system-agent:* approval card.
  • Pending history contains no final tool result, /approve fallback, needsApproval, or proposalId.
  • Pending and settled session reloads preserve the expected card/result state.
  • Approval ordering is operator resolution → card removed → applied resolution → chat final.
  • Settled history and the rendered Control UI independently prove the final tool result without asserting cross-channel DOM/WebSocket ordering.
  • An init-time observer fails the test if fallback approval text appears transiently.
  • The settled reload assertion is scoped to the restored tool-result body.

Verified locally:

  • node scripts/run-vitest.mjs src/scripts/ci-changed-scope.control-ui.test.ts --run — 54 passed
  • node scripts/check-changed.mjs -- extensions/qa-lab/src/control-ui-openclaw-delegation.real-gateway.e2e.test.ts scripts/ci-changed-scope.mjs src/scripts/ci-changed-scope.control-ui.test.ts — passed
  • Focused format, lint, extension/core test typecheck, dead-export checks, and autoreview — passed

The Playwright browser case could not execute on this host because Chromium requires libnspr4.so; the exact-head hosted real-Gateway job is the browser proof.


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 8:31 PM ET / September 4, 2026, 00:31 UTC.

ClawSweeper review

What this changes

The branch adds a real-Gateway Control UI regression test for native approval completion across reloads and routes changes to that test through Chromium UI CI.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this maintainer-labelled PR open for the remaining exact-head CI/maintainer gate. The focused real-Gateway regression covers a distinct two-phase system-agent approval lifecycle; no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 4cb102bbcd0089c6a8a7000b0caa85ea5c3f4f71
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-oriented real-Gateway regression test with appropriate CI routing and no identified patch defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable to the member-authored test-only PR; the relevant supplied CI status includes a successful real-Gateway browser job, while this read-only review did not execute the scenario.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable to the member-authored test-only PR; the relevant supplied CI status includes a successful real-Gateway browser job, while this read-only review did not execute the scenario.
Evidence reviewed 6 items Introduced real-Gateway regression: The added scenario starts an isolated Gateway and browser, verifies pending-card and history state, reload hydration, Allow once, two resolution phases, final result, and settled reload behavior.
Current owner behavior: The current owner registers a two-phase system-agent approval, retains completion until application, and publishes the application-status resolution; the same owner files are unchanged between this branch and current main.
Caller and UI boundary: The chat handler waits for retained approval completion before producing the final result, while the UI parses system-agent approval events into its shared queue and removes resolved cards.
Findings None None.
Security None None.

How this fits together

The Control UI receives approval and chat-final events from the Gateway and renders a native approval card while a delegated configuration change awaits an operator decision. Once the decision settles, the Gateway records the tool result and the UI restores it across session reloads.

flowchart LR
  A[Delegated configuration request] --> B[Gateway approval owner]
  B --> C[Approval events]
  C --> D[Control UI native card]
  D --> E[Operator decision]
  E --> F[Settled tool result]
  F --> G[Reloaded chat transcript]
Loading

Decision needed

Question Recommendation
Should a listed owner accept this maintainer-labelled regression-coverage PR after the exact-head UI matrix is complete? Accept after matrix completion: Confirm the exact-head UI E2E matrix is fully green, then approve the focused regression coverage.

Why: The patch has no source-level blocker, but the protected maintainer label requires explicit maintainer handling and the supplied check projection cannot establish completion of every UI shard.

Before merge

  • Resolve merge risk (P1) - This changes CI path classification. The supplied status snapshot shows the real-Gateway job succeeded, but its check collection is truncated/incomplete, so the prior request to establish a fully green exact-head UI matrix is not independently complete.
  • Complete next step (P2) - Confirm the complete exact-head UI E2E matrix and obtain listed-maintainer review before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Tests +302, Other 0. Total +302 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 307 5 +302
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 3 308 6 +302

Review metrics

Metric Value Why it matters
Production versus test delta production/tooling +1/-1 (net 0); tests +307/-5 (net +302) The only non-test change is an exact CI-scope rule; the substantive growth is a browser regression scenario and its routing assertion.

Merge-risk options

Maintainer options:

  1. Verify the complete exact-head UI matrix (recommended)
    Wait for all required UI E2E shards on the current head before merging the new CI routing rule.
  2. Pause the coverage addition
    Leave the PR open if the remaining exact-head matrix cannot establish that the routing change is stable.

Technical review

Best possible solution:

Retain the focused real-Gateway regression and its exact-path CI routing, then merge only after the exact current-head UI matrix is complete and a listed maintainer accepts the protected review.

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

Not applicable: this is regression-coverage work, not a proposed production repair. The source-defined browser scenario is clear, but this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Existing mock UI E2E tests cover generic queue behavior, while this scenario exercises the actual Gateway's system-agent two-phase lifecycle and reload hydration without adding a production seam.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cd8c74889d21.

Labels

Label justifications:

  • P2: This protects a default Control UI approval lifecycle with limited blast radius and adds no production behavior.
  • merge-risk: 🚨 automation: The branch changes the classifier that determines whether Chromium UI CI runs for this real-Gateway test.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable to the member-authored test-only PR; the relevant supplied CI status includes a successful real-Gateway browser job, while this read-only review did not execute the scenario.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Lehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the complete exact-head UI E2E matrix, then obtain the required maintainer review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-03T18:32:56.792Z sha bb18f81 :: blocked before merge. :: [P2] Pass sessionKey into the page init script
  • reviewed 2026-09-03T19:08:20.674Z sha 20d3527 :: blocked before merge. :: none
  • reviewed 2026-09-03T19:41:13.319Z sha 28b13ef :: blocked before merge. :: none
  • reviewed 2026-09-03T20:13:56.335Z sha 338e251 :: blocked before merge. :: none
  • reviewed 2026-09-03T20:46:50.712Z sha 8b25864 :: blocked before merge. :: none
  • reviewed 2026-09-03T21:17:00.250Z sha be1ef76 :: blocked before merge. :: none
  • reviewed 2026-09-03T21:51:19.232Z sha 8661911 :: blocked before merge. :: none
  • reviewed 2026-09-03T22:09:44.124Z sha 2b33b7c :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 3, 2026
@jalehman

jalehman commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 3, 2026
@jalehman

jalehman commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 3, 2026
@jalehman

jalehman commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Sep 3, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 3, 2026
@jalehman

jalehman commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Sep 3, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Sep 3, 2026
@jalehman

jalehman commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Sep 3, 2026
@jalehman

jalehman commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@jalehman
jalehman merged commit 8f986e0 into main Sep 4, 2026
600 of 610 checks passed
@jalehman
jalehman deleted the openclaw/persist-native-approval-cards-after-finalization branch September 4, 2026 14:46
vincentkoc added a commit that referenced this pull request Sep 4, 2026
…9-prep

* commit '407a8f453c0f0306af1ddc0aafa8697c1d49a9e7': (312 commits)
  perf(ui): coalesce automation event refreshes (#138065)
  fix: reject incomplete Skill Workshop directory reads (#138082)
  test(ui): decouple rendering checks from generated wording (#138283)
  perf: avoid temporary entries in bounded JSON traversal (#138017)
  fix(irc): render complete messages before splitting (#138328)
  perf: prepare worker trajectory payloads only for recorded events (#138086)
  fix(mcp): paginated listings no longer time out after a forward clock step (#137206)
  fix(codex): page native transcripts and bound UI previews (#136282)
  feat(gateway): apply more settings without restarting (#138112)
  fix(docs): preserve mirrored ClawHub maturity links (#138241)
  fix(test): own UI animation and legacy database setup (#138296)
  fix(tts): preserve literal directives in Markdown code (#138319)
  fix: load chat widgets behind authenticated gateways (#138074)
  chore(ui): cover native approval finalization (#137259)
  fix(cron): cancel conditions before main-session handoff (#138313)
  fix(backup): preserve text after embedded NUL characters (#138327)
  fix(android): align composer control sheets (#137442)
  fix(ci): wait for replacement PR runs instead of stale failures (#138307)
  fix(sessions): keep Gateway responsive with long transcripts (#138094)
  fix(computer): map window inputs to delivered image coordinates (#138271)
  ...

# Conflicts:
#	scripts/release-check.ts
#	test/release-check.test.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
* test(ui): cover native approval finalization

* test(ci): route approval gateway coverage

* test(ui): fix native approval gateway coverage

* test(ui): ignore retiring approval socket events

* test(ui): model two-phase approval completion

* test(ui): prove settled approval result without DOM ordering

* test(ui): allow concurrent approval cleanup events

* test(ui): assert settled result after reload

* test(ui): expand settled work after reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant