Skip to content

fix(browser): visibly report failed pairing and tab-sharing actions - #119526

Merged
steipete merged 5 commits into
mainfrom
codex/autoqa-browser-action-outcomes-20260805
Aug 5, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/autoqa-browser-action-outcomes-20260805

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes browser actions that silently fail or falsely report success: rejected Pair/Unpair/Share operations could leave the popup without a visible outcome, and tab sharing/unsharing acknowledged success before its required consent reconciliation completed.

Why This Change Was Made

Give the browser background listener one settlement owner, report each asynchronous action failure exactly once, await consent reconciliation before acknowledging tab sharing, and display rejected unpair/share responses in the popup section that remains visible while paired. Existing pairing errors, successful actions, single-response behavior, and Chrome's callback listener contract (return true) remain unchanged.

User Impact

A browser operator now sees actionable failures when pairing, unpairing, sharing, unsharing, or consent reconciliation fails. Successful tab sharing is acknowledged only after its existing consent owner has completed; no credentials, consent policies, plugin contracts, or product configuration changed.

Evidence

  • Authentic remote RED: both real share and unshare flows previously mutated the tab, received a rejecting onConsentChanged(), and incorrectly returned {ok: true}.
  • Authentic remote GREEN uses the real background controller and verifies exactly one {ok: false, error} response for both reconciliation failures, while retaining Chrome's literal return-true asynchronous listener contract.
  • Popup regressions load the actual shipped popup HTML and JavaScript, click real Share/Unpair buttons, and verify the failure remains visibly rendered without dismissing the settings panel.
  • Trusted Blacksmith Testbox: 34 tests passed across 3 files: pnpm test extensions/browser/chrome-extension/background.test.ts extensions/browser/chrome-extension/popup-errors.test.ts extensions/browser/chrome-extension/modules/copilot-background.test.ts
  • The complete scoped pnpm check:changed -- passed, including production/test TypeScript, lint, formatting, import cycles, plugin boundaries, and config/security guards.
  • A complete packaged pnpm build passed and copied the repaired browser assets into the production distribution.
  • Hosted Testbox run: https://github.com/openclaw/openclaw/actions/runs/30982511971
  • Production delta: 24 additions / 9 deletions (+15 net), justified by canonical exactly-once outcome ownership and operator-visible error handling; regression tests: 260 additions / 3 deletions.

Real installed Chromium browser-plugin proof

Verified the complete current browser owner change on trusted Blacksmith Testbox run 31010603420.

The end-to-end test starts real Playwright-managed Chromium, loads the actual unpacked MV3 browser plugin and its real service worker, connects to an isolated local relay, opens the actual extension toolbar popup through Chrome DevTools Protocol, and clicks its real Share button with a genuinely missing Chrome tab. Real Chrome returns its missing-tab error. The test observes both the immediate action reconciliation and a later completed periodic status refresh, and proves the exact error remains visible. This is source-backed real-browser interaction; the separate full production build also copied the browser plugin into packaged assets.

Observed remote output:

popup/controller/copilot: 3 files, 40 tests passed
Chromium sidepanel + toolbar popup: 2 files, 6 tests passed
✓ keeps a real stale-tab sharing error visible across the popup status poll
✓ node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json [five touched browser files]
✓ pnpm build — includes browser plugin asset build/copy and Control UI production build

Exact reviewed failure-path coverage now includes failed pair/unpair/share/unshare, partially persisted pairing, partially applied tab-sharing changes, consent-reconciliation failures, failed getStatus polls, both actual popup refreshes, successful retry/re-pair clearing stale failures, and single-settlement async background callbacks. Existing settings and connected panes stay truthful. No authentication, provider, public configuration, protocol, or persistence contract changed.

The previous ClawSweeper P2 and both rank-up moves are addressed by the canonical popup-owned action error lifecycle, timer-advanced real-DOM regressions, and the real installed-Chromium interaction above.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@steipete
steipete marked this pull request as ready for review August 5, 2026 07:00
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 10:07 AM ET / 14:07 UTC.

ClawSweeper review

What this changes

The PR gives the browser popup durable, visible errors for failed pairing and tab-sharing actions, while making the background worker settle each request only after consent reconciliation.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

The PR remains necessary: current main can acknowledge tab sharing before consent reconciliation and can leave rejected background actions unanswered. The updated head repairs those paths with sufficient real Chromium proof; the protected maintainer label leaves landing to an explicit maintainer decision.

Priority: P2
Reviewed head: 8c836d630131210fd5f0c15411581382936d90fe
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The focused owner-boundary repair has strong real-browser proof and no actionable correctness or security finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR body documents an exact-head installed-Chromium run using the real unpacked extension, service worker, toolbar popup, Chrome error, and post-refresh visible result.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR body documents an exact-head installed-Chromium run using the real unpacked extension, service worker, toolbar popup, Chrome error, and post-refresh visible result.
Evidence reviewed 6 items Current-main failure path: Current main sends a successful share/unshare response before awaiting consent reconciliation, and its async message handler has no outer rejection response.
Canonical settlement repair: The PR’s background worker uses one once-only response owner, catches asynchronous failures, and returns share success only after the consent owner completes.
Visible popup outcome: The popup retains a rejected action error through status refreshes and clears it only after a successful retry.
Findings None None.
Security None None.

How this fits together

The browser extension popup requests pairing and tab-sharing actions from its MV3 background service worker. That worker changes Chrome tab grouping, reconciles Copilot consent/session state, and returns the result the popup renders to the operator.

flowchart LR
  Operator[Browser operator] --> Popup[Extension popup]
  Popup --> Worker[Background service worker]
  Worker --> Tabs[Chrome tab groups]
  Worker --> Consent[Copilot consent reconciliation]
  Consent --> Result[Settled action result]
  Result --> Popup
Loading

Decision needed

Question Recommendation
Should this protected maintainer PR be landed at its reviewed head? Land the reviewed head: Merge the clean, proof-backed repair after confirming the current GitHub merge state.

Why: The patch is technically ready, but the protected maintainer label requires an explicit maintainer landing decision.

Before merge

None.

Agent review details

Security

None.

PR surface

Source +33, Tests +641. Total +674 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 45 12 +33
Tests 3 644 3 +641
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 689 15 +674

Review metrics

Metric Value Why it matters
Production vs test delta production +45/-12; tests +644/-3 The production growth is justified by one-settlement response ownership and durable operator-visible errors; the tests cover the popup lifecycle and real Chromium path.

Stored data model

Persistent data-model change detected: serialized state: extensions/browser/chrome-extension/popup-errors.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the reviewed head after maintainer confirmation, retaining the background worker as the single settlement owner and the popup as the durable visible-error owner.

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

Yes—current main visibly sends sharing success before its consent await, while the PR’s installed-Chromium path exercises the resulting missing-tab failure and popup refresh lifecycle.

Is this the best way to solve the issue?

Yes—the background owns exactly-once settlement and consent completion, while the popup owns persistent operator-visible action errors; the distinct side-panel Port flow has its own state and error channel.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body documents an exact-head installed-Chromium run using the real unpacked extension, service worker, toolbar popup, Chrome error, and post-refresh visible result.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body documents an exact-head installed-Chromium run using the real unpacked extension, service worker, toolbar popup, Chrome error, and post-refresh visible result.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs a visible browser-plugin action failure with limited blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body documents an exact-head installed-Chromium run using the real unpacked extension, service worker, toolbar popup, Chrome error, and post-refresh visible result.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body documents an exact-head installed-Chromium run using the real unpacked extension, service worker, toolbar popup, Chrome error, and post-refresh visible result.

Evidence

What I checked:

Likely related people:

  • steipete: Merged history attributes the browser pairing, Copilot panel, and page-share lifecycle to this contributor, in addition to the current repair. (role: feature owner; confidence: high; commits: 4efcea1fd223, 654029892dcb, ec8f6e5e0358; files: extensions/browser/chrome-extension/background.js, extensions/browser/chrome-extension/popup.js, extensions/browser/chrome-extension/page-share.e2e.test.ts)
  • vincentkoc: Recent browser-Copilot E2E CI work is directly relevant to the installed-Chromium proof lane. (role: adjacent test owner; confidence: medium; commits: 90a22b4f5022; files: extensions/browser/chrome-extension/page-share.e2e.test.ts)

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 (1 earlier review cycle)
  • reviewed 2026-08-05T07:36:37.403Z sha 2060204 :: needs real behavior proof before merge. :: [P2] Preserve rejected-action errors across popup refreshes

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 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 repository_dispatch).
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 proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 5, 2026
@steipete
steipete merged commit b3f3da1 into main Aug 5, 2026
131 of 134 checks passed
@steipete
steipete deleted the codex/autoqa-browser-action-outcomes-20260805 branch August 5, 2026 14:22
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 5, 2026
* origin/main: (130 commits)
  refactor(qa): consolidate scenario runtime helpers (openclaw#119623)
  fix(telegram): bind Mini App auth to dashboard launches
  refactor(agent-core): unify session projection and compaction summaries (openclaw#119639)
  fix(codex): allow natural reactions in the current conversation (openclaw#119649)
  refactor(providers): deduplicate bundled model catalogs (openclaw#119627)
  fix(ui): observe the active service worker after asset refresh (openclaw#119622)
  fix(agents): strip echoed base64 image payloads so photo-heavy turns no longer hit the per-turn output cap (openclaw#119488)
  improve: make state-heavy test suites faster (openclaw#119617)
  perf(agents): add concurrency benchmark (openclaw#119569)
  fix(browser): visibly report failed pairing and tab-sharing actions (openclaw#119526)
  refactor(lobster): consolidate embedded workflow execution (openclaw#119630)
  fix(plugin-sdk): stabilize tuple-derived API baseline ordering (openclaw#119635)
  docs(skills): make full-authority maintainer runs unattended (openclaw#119629)
  fix(managed-child): honor process groups that vanish before cleanup (openclaw#119614)
  fix(ci): stop label-driven automation churn (openclaw#119610)
  fix(media): keep the ttl sweep out of the managed outgoing tree (openclaw#119127)
  fix(claws): remove owner-qualified skills (openclaw#119606)
  fix(clawrouter): show stable error for malformed usage responses (openclaw#119580)
  fix(gateway): claim malformed plugin icon routes (openclaw#119559)
  fix(telegram): preserve truthful empty-content delivery (openclaw#88810)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
…penclaw#119526)

* fix(browser): surface extension action errors exactly once

* fix(browser): reuse typed extension error response handler

* fix(browser): settle tab sharing only after consent reconciliation

* fix(browser): retain popup action errors across status refreshes

* fix(browser): preserve popup failures across state transitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L 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