Skip to content

fix(doctor): identify malformed legacy exec approval fields - #133952

Merged
steipete merged 8 commits into
mainfrom
steipete/admiring-williamson-39fb9d
Aug 31, 2026
Merged

steipete merged 8 commits into
mainfrom
steipete/admiring-williamson-39fb9d

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #118242, #118282.

What Problem This Solves

Fixes an issue where operators running Doctor against malformed legacy exec approvals receive only a generic preservation warning, leaving them unable to locate the field that needs repair. Thanks @sercada for reporting the original upgrade problem; #118282 already handles the historical nullable-metadata migration.

Required CI exposed independently reproducible avatar lifecycle, browser tab inventory, and fixture defects. This PR includes those bounded owner repairs under the authorized landing scope. The maintainer has accepted the combined maintenance scope; the final prepared-head decision remains separate.

Why This Change Was Made

The strict parser now returns either canonical policy or one bounded, value-free diagnostic. Doctor displays a fixed field path and static reason, using a one-based agent ordinal and zero-based allowlist index. The nullable runtime parser delegates to the same strict owner; only Doctor applies the already-existing legacy null normalization. The schema, canonical row decisions, source preservation, migration receipts, and fail-closed runtime gate are unchanged. Agent keys, patterns, commands, socket paths/tokens, and raw validation exceptions never enter diagnostics; diagnostic text is not persisted in receipts.

The shared protected-avatar loader now owns its five Lit consumers' connection lifecycle, preventing queued renders after disconnect from reacquiring orphan requests. An ownerless 503 result is removed through the existing cleanup path so immediate reconnect can retry. Both browser inventory publishers revalidate discovery generation after awaited reads, preventing stale inventory from retiring a newly handed-off tab session. Access and revocation checks remain intact.

The retained tests now wait for process-tree readiness and a resting mobile touch state. Assertions and existing test, command, and cleanup deadlines remain intact. Main #134033, #134031, #134207, and #134014 now own the prepared-model fixture, lint resource chooser, Gateway fixture corrections, and dropdown focus synchronization respectively; duplicate commits were dropped during actual conflict refreshes. Those files have no delta in this PR.

User Impact

Doctor identifies, for example, agents entry #2.allowlist[1].lastUsedAt: expected a finite number while preserving malformed input and refusing runtime approvals. Correcting the identified field lets the normal import finish. Protected avatars recover across disconnect/reconnect, and browser targets survive an overtaken inventory read.

There are no new config/environment options, dependencies, protocol/schema changes, approval-policy changes, or releases. Runtime LOC is +195/-77 (net +118): diagnostic projection +124, shared avatar lifecycle consolidation -19, and browser publication fencing +13. The diagnostic growth implements a value-free projection unavailable from generic Zod formatters; the browser growth validates the two publication boundaries. Tests are +565/-251 (net +314), including the moved icon suite; docs +4, tooling 0. Nineteen files remain in the PR.

Evidence

  • Doctor: pre-fix main produced 14 expected diagnostic failures with 12 passes. Owner/parser/store/Doctor/node-host proof passed 187 tests; plugin-binding siblings passed 6 selected cases; the final parser/migration selection passed 59. A full candidate build and complete selected checks passed. The isolated dist-backed CLI identified the second agent's second entry, preserved exact source bytes, leaked no synthetic private markers, and returned nonzero for Doctor and runtime approvals. Changing only lastUsedAt to 0 allowed import, source retirement, and successful approvals read. All synthetic states were cleaned. The fresh integrated result on the final refresh is recorded below.
  • Dependency contracts: installed Zod 4.4.3 core/schemas.ts:2167–2248, errors.ts:345–359, and util.ts:837–868 were inspected directly for union-relative paths and value exposure. Installed Lit's queued-update/connection contract, Web Awesome's post-animation focus assignment, and Playwright/Chromium touch behavior were inspected at their owners.
  • Avatars: controlled queued-render/disconnect ordering failed before repair, including the predecessor's unexpected route. Owner/sibling proof passed 417 tests, the Linux UI group passed 3,606 with 53 skips, and the final loader/header selection passed 58. The immediate-reconnect regression failed at one request instead of two before repair. Inspected synthetic before/after browser evidence and same-task disconnect/503/reconnect proof show recovery, no detached retry, reopening, exactly two immediate-reconnect requests, a decoded image, and no browser errors. Six production source hashes still match; resources are stopped.
  • Browser inventory: holding a completed real policy read across target creation/handoff produced Session not found before repair. All 189 owner/relay/access tests passed. Native Linux Chromium proof passed both all-tab and selected-tab modes, same-target navigation and snapshot, preserved unrelated pages, and verified page/relay/MCP/HTTP cleanup. This proves the controlled ownership defect; the original hosted CDP sequence was not logged.
  • Fixtures: the dropdown regression uses actual animation completion and passes all 6 cases. A controlled 3.1-second cold start reproduced the cancellation fixture's old two-second pre-signal timeout; event-driven readiness passes with the original SIGTERM/exit/descendant-death assertions. All 85 process/helper tests passed with one platform skip, followed by 137 combined diagnostic/UI/cancellation tests. The alleged check/listen race was declined with direct Node source and forced-order real-child proof; no assertion was weakened.
  • Mobile metadata: a real touch beginning during active tool work and ending after completion deterministically left disclosure active; moving the mouse cannot clear that intentional state. The extended desktop/mobile case verifies absent footer during work, disclosure after completion, then taps another row before asserting rest. Removing the rest tap fails the mobile case while desktop passes. All 12 streaming E2E cases and all 92 tests/26 files in the actual Linux shard7/13 passed, along with the full selected gate and fresh Codex review. Same shard membership is proven; cached execution order differed from historical CI. Linux command proof completed with matching source hashes and command/capture exit0; its lease was stopped.

CI repair history and limits:

  • Run33382531572 initially had 47 anonymous Git Checkout failures before tests. A secretless exact-merge fetch then succeeded; one supported failed-job retry was used for CI and OpenGrep. OpenGrep passed on attempt2. Subsequent test failures were investigated and repaired rather than blindly retried.
  • Run33388250673 lost its lint runner twice, including one targeted retry. The historical kernel cause remains unknown. A controlled Linux14GiB/no-swap budget reproduced OOM, and the automatic chunk chooser passed all155 targets/21 chunks plus scripts/i18n/style checks in368.67s, maxRSS9,102,396KiB, cgroup peak9,802,514,432bytes, with zero OOM events and command/systemd/capture exit0. The task-owned proof lease was stopped. Chunking trades repeated program setup for memory headroom. This measurement belongs to the prior chooser commit; main fix(doctor): coordinate explicit repair with the managed gateway #134031 now owns the broader canonical low-memory serial chooser, with 62 wrapper tests and complete target coverage verified. It is not a new-head automatic proof or retrospective diagnosis of GitHub's shutdown.
  • Hosted lint passed in run33397505468, which exposed the mobile fixture assumption above. Its historical pointer sequence remains unknown.
  • Run33405420957 completed with181 successful jobs,13 skips, and two deterministic static-check failures plus their aggregate: Promise-executor return lint and Gateway fixture types. Both reproduced locally. The corrected two-file candidate passed7 Linux tests and the complete selected gate (39.57s/272.30s, command/capture exit0, six hashes unchanged), with fresh Codex review. An initial raw-source candidate failed an existing assertion because its import-time path differed from the current fixture; the final candidate used the snapshot owner's path. Its proof lease was stopped. Main fix: restore gateway recovery fixture lint and types #134207 then landed equivalent fixes; the duplicate commit was dropped at the real conflict, preserving upstream.

Latest ClawSweeper review, reviewed at4ac68682 on August31 17:08UTC, reports no code findings. Its scope rank-up move is addressed by maintainer acceptance of this maintenance batch; its dependency-environment gap is addressed by the direct Zod inspection above. Exact-head required CI and native preparation have completed; final prepared-head approval remains separate.

Current conflict refresh: a95e15ec3afa71c6e7511d2253fee01f40698585, based on main 9cc05cca83e20179ae78fdc3fd2232c262414ea7. Main #134014 independently supplied the same dropdown focus and hidden-popup waits; the actual conflict was resolved by preserving that file exactly as upstream while retaining the browser repair. All19 remaining PR file blobs are byte-identical to the previously reviewed head. The upstream focus suite passed all6 cases and a fresh whole-branch Codex review was scoped-clean at P0. The preceding refresh had passed66 Gateway/diagnostic tests and12 streaming E2E cases. No source edits followed review.

Run33411024583 had183 successful jobs and13 skips, with only its aggregate queued when the actual main conflict stopped the watcher. No test failure or retry was involved. A full local build on that superseded head was deliberately interrupted with exit143; every owned child/process group was verified stopped before source changed. Its partial output is not claimed as a completed build. The final CLI probe uses the repository's normal runtime build/postbuild path and verifies both build stamps against the exact head; declaration-only build work is not represented as completed.

Fresh integrated CLI proof at a95e15ec3afa71c6e7511d2253fee01f40698585: the normal runtime build completed successfully in23.9s, both build/postbuild stamps match the exact head, and the native-load check verified38 plugin control-plane modules. With fresh isolated synthetic state, Doctor printed the bounded second-agent/second-entry lastUsedAt warning, preserved exact bytes, and leaked no private markers. approvals get exited1. Correcting only that field to0 let Doctor import and retire the source; both Doctor and approvals read then exited0, and the corrected policy was readable. No approvals payload was retained, and all fresh synthetic states were cleaned.

Malformed Doctor itself exits0 on the current upstream behavior. #133773, commit 122232dc7792b75934e6961dd60a3c5f9d81b80c, deliberately catches pending approval migration in Doctor security checks and post-import cleanup so the rest of Doctor can continue. The raw parent diff was checked directly. The earlier Doctor exit1 was the pending-migration gate error removed by that repair. This PR leaves that upstream exit behavior intact and keeps the runtime gate fail-closed. The maintainer accepted this current upstream contract after checking its source and raw parent diff. The original harness result remains recorded as exit1 because it expected Doctor1; the completed command observations satisfy the corrected contract. No rerun or exit-policy change was needed.

Latest documentation conflict refresh: ad59723dfd7fc8d3392dfbaecf5b9aecc09421d5 on 692cb7b1f28f910e59e8f4ee0acb5cb27f45667a. The adjacent auth-archive recovery note from #134009 and all four diagnostic lines are preserved. All18 runtime/test file blobs are unchanged; formatting and fresh whole-branch Codex P0 review passed. CI33413428719 completed successfully on the preceding head; CI33415464804 is attached to this new exact head.

The complete isolated CLI flow was repeated on the latest head after a39.19-second successful normal runtime build; both stamps match ad59723dfd7fc8d3392dfbaecf5b9aecc09421d5. Results remain Doctor0 with the bounded warning, source bytes preserved/no marker leak, approvals get1; after changing only the indicated field, Doctor0/import/source retirement and get0/corrected policy. Synthetic state was cleaned. The maintainer accepted the corrected Doctor0 warning contract; the original failed harness expectation remains preserved separately. No exit policy or production code was changed to force that expectation.

Required CI follow-through at ad59723d: UI E2E job99565202388 passed82 cases and failed the held-touch fixture at scrollIntoViewIfNeeded, where the selected bubble detached during the tool projection. The working indicator was already visible before the tool event; it did not prove that the deferred tool card had rendered. Direct Playwright source inspection confirms that this scroll method retains one element handle. A controlled real-browser probe on both viewports showed the already-visible indicator and the old bubble becoming disconnected, then reproduced the same scroll error. The fixture now waits for the specific tool card before selecting the touch target (+3 test lines, no production change). All12 streaming E2E cases passed, and fresh Codex P0 autoreview was scoped-clean. Original footer, held-touch, recovery, identity, and timestamp assertions and all deadlines remain unchanged. The full selected check-changed command passed. The correction is committed as 4ac68682a089bf279ba6fcf889ac6e899162352f; exact-head CI and native preparation have now completed successfully. This establishes the faulty fixture boundary; the hosted run did not retain the precise browser callback ordering.

Final prepared head: 4ac68682a089bf279ba6fcf889ac6e899162352f. CI33416971947 completed successfully with184 successful jobs and13 intentional skips; Workflow Sanity33416972078 also passed. OPENCLAW_TESTBOX=1 scripts/pr prepare-run 133952 completed successfully using exact-head evidence, with no rebase, source change, or extra push. All ClawSweeper rank-up moves are addressed by green exact-head CI and maintainer scope acceptance. The final prepared-head merge decision remains separate.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 08:05
@steipete
steipete force-pushed the steipete/admiring-williamson-39fb9d branch from 9cd2e68 to be9f89f Compare August 31, 2026 08:08
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 1:08 PM ET / 17:08 UTC.

ClawSweeper review

What this changes

This PR adds redacted field-level Doctor diagnostics for malformed legacy exec-approval files, plus browser-tab inventory fencing, Control UI avatar lifecycle repairs, and focused reliability tests.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for final maintainer acceptance: current main does not contain the branch’s bounded malformed-approval diagnostic or its browser/UI repairs, and no introduced blocking defect was found.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The branch has strong submitted behavior evidence and no source-proven blocking defect, with exact-head CI and maintainer scope acceptance still required.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The supplied evidence connects the changed Doctor migration owner to an isolated built CLI transition from preserved malformed input and blocked approvals to repaired import, and connects the avatar owner to Chromium 503/disconnect/reconnect recovery; the final commit is test-only relative to those production owners.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The supplied evidence connects the changed Doctor migration owner to an isolated built CLI transition from preserved malformed input and blocked approvals to repaired import, and connects the avatar owner to Chromium 503/disconnect/reconnect recovery; the final commit is test-only relative to those production owners.
Evidence reviewed 7 items Current-main gap: Current main retains the nullable parser that returns null for invalid persisted approval JSON; the branch adds the Result-based diagnostic projection, so the central Doctor behavior is not already implemented on main.
Doctor owner boundary: The introduced parser produces only allowlisted field names and static reasons, and the migration adds that message only when it preserves malformed legacy input; canonical parsing and runtime fail-closed behavior remain on the existing nullable path.
Migration coverage: The introduced regression matrix checks field locations, hostile-value redaction, syntax and UTF-8 failures, byte preservation, receipt privacy, idempotence, and continued runtime blocking.
Findings None None.
Security None None.

How this fits together

Doctor imports legacy approval policies into canonical SQLite state while preserving malformed sources for operator recovery and keeping approvals fail-closed. The browser extension publishes accessible tabs to the relay, while Control UI components fetch protected avatar routes for visible state.

flowchart LR
  A[Legacy approval file] --> B[Doctor migration]
  B --> C[Redacted validation diagnostic]
  C --> D[Operator repair]
  D --> E[Canonical approval state]
  F[Browser tab events] --> G[Revision-checked inventory]
  G --> H[Relay and Control UI]
Loading

Decision needed

Question Recommendation
Does the maintainer accept this combined Doctor, browser, and Control UI maintenance batch on its final head once exact-head CI is green? Accept after exact-head CI: Confirm the combined scope remains accepted and merge after the final required checks verify the prepared head.

Why: The PR is maintainer-authored, carries the protected maintainer label, and changes an upgrade-sensitive fail-closed migration message alongside several reliability repairs.

Before merge

  • Resolve merge risk (P1) - Malformed legacy approval files deliberately remain fail-closed until repaired, so the operator-facing migration path needs exact-head CI before landing.
  • Resolve merge risk (P1) - The review checkout lacks installed Zod source and GitHub DNS was unavailable, so the Zod union-child diagnostic contract could not be independently reopened; this is a reviewer-environment limitation, not a source-proven defect.
  • Complete next step (P2) - A protected, maintainer-authored PR needs final human scope acceptance and exact-head CI rather than an automated repair.
Agent review details

Security

None.

PR surface

Source +118, Tests +314, Docs +4. Total +436 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 11 195 77 +118
Tests 7 565 251 +314
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 764 328 +436

Review metrics

Metric Value Why it matters
Production versus test delta production +195/-77 (net +118); tests/support +565/-251 (net +314); docs +4 The positive production growth is concentrated in value-free diagnostics and two lifecycle/publication owner repairs; the branch adds targeted regression coverage for each.
Migration diagnostic surface 1 legacy approval recovery message path added This changes what operators see while repairing retained legacy approval data, without adding configuration or altering the canonical policy schema.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/infra/state-migrations.exec-approvals.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Verify the final migration path (recommended)
    Require exact-head CI to confirm malformed files remain preserved and approvals remain blocked until the operator repairs the named field.
  2. Pause for a narrower scope
    Keep the branch open if the combined Doctor, browser, and UI maintenance scope is no longer desired.

Technical review

Best possible solution:

Land the parser-owned, value-free diagnostic and lifecycle-owner repairs only after exact-head CI confirms the preserved-file and upgrade behavior on the final branch.

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

Yes, source-reproducible: the migration regression cases construct malformed legacy files and assert the preserved-file, diagnostic, receipt, and runtime-gate outcomes; the supplied PR evidence also describes an isolated CLI before/after run.

Is this the best way to solve the issue?

Yes: exposing a bounded diagnostic at the strict parser and consuming it only in the Doctor migration avoids raw-value leakage and avoids weakening canonical approval validation.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded upgrade-recovery and reliability repair with no source-proven emergency regression.
  • merge-risk: 🚨 compatibility: The PR changes operator-visible behavior on a fail-closed legacy approval migration path that existing upgrades can encounter.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The supplied evidence connects the changed Doctor migration owner to an isolated built CLI transition from preserved malformed input and blocked approvals to repaired import, and connects the avatar owner to Chromium 503/disconnect/reconnect recovery; the final commit is test-only relative to those production owners.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied evidence connects the changed Doctor migration owner to an isolated built CLI transition from preserved malformed input and blocked approvals to repaired import, and connects the avatar owner to Chromium 503/disconnect/reconnect recovery; the final commit is test-only relative to those production owners.

Evidence

What I checked:

  • Current-main gap: Current main retains the nullable parser that returns null for invalid persisted approval JSON; the branch adds the Result-based diagnostic projection, so the central Doctor behavior is not already implemented on main. (src/infra/exec-approvals-config.ts:131, d147d40f4f1c)
  • Doctor owner boundary: The introduced parser produces only allowlisted field names and static reasons, and the migration adds that message only when it preserves malformed legacy input; canonical parsing and runtime fail-closed behavior remain on the existing nullable path. (src/infra/exec-approvals-config.ts:155, 4ac68682a089)
  • Migration coverage: The introduced regression matrix checks field locations, hostile-value redaction, syntax and UTF-8 failures, byte preservation, receipt privacy, idempotence, and continued runtime blocking. (src/infra/state-migrations.exec-approvals.test.ts:181, 4ac68682a089)
  • Browser and UI ownership: The branch rechecks tab discovery revision across awaited reads and moves five avatar consumers to a lifecycle-owning Lit controller; source and focused tests preserve access eligibility, disconnect cleanup, and reconnect behavior. (extensions/browser/chrome-extension/background.js:196, 4ac68682a089)
  • Introduced provenance: The Doctor diagnostic commit has the verified merge-base parent and introduces the parser/migration/docs change; its commit timestamp is 2026-08-31T09:39:13-07:00. (src/infra/exec-approvals-config.ts:155, 2c10967db5f1)
  • Release status: No tag contains the PR head; it remains unshipped branch work rather than an implemented-on-main candidate. (4ac68682a089)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • sercada: 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.

  • Complete exact-head CI for the final prepared head.
  • Confirm the combined maintenance scope before merge.

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 (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-31T11:13:18.697Z sha 01a49e4d1e2018c98a78d648b323924c4d33fc32 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T11:51:08.509Z sha 34dbaa1 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T13:14:57.929Z sha 7f0ee60dcc8d335572f0c0b7fb7f0e85768341a4 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T13:40:17.735Z sha 792dab7cefff400b9192d41ea9e349f21df8e503 :: found issues before merge. :: [P2] Make the readiness wait lossless
  • reviewed 2026-08-31T15:03:17.067Z sha d2c51d0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T16:09:03.131Z sha fd485c4 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T16:36:20.491Z sha a95e15e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T16:49:34.671Z sha ad59723 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L and removed size: M labels Aug 31, 2026
@steipete
steipete force-pushed the steipete/admiring-williamson-39fb9d branch from f2e1f41 to fd4d6b1 Compare August 31, 2026 09:17
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The diagnostic patch is unchanged. Commit fd4d6b1391e5cea2b4083b36d659d4315be4966c adds the CI follow-through described in Evidence: a queued Lit render could reacquire an avatar route after disconnect, allowing an orphan retry to consume the replacement icon's response. The shared loader now owns connection/release for all five consumers (net -19 production lines), with strict request-URL, disconnect/reconnect, and visible recovery tests.

The controlled pre-fix ordering reproduced the three-fetch failure; the original hosted log omitted URLs, so its historical third caller remains unproven. Focused tests, the Linux UI group, UI build, final selected checks, and fresh Codex autoreview passed. Exact-head hosted CI and Browser-pane proof are still pending. Please review this added lifecycle behavior as well as the original diagnostic change.

@clawsweeper

clawsweeper Bot commented Aug 31, 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 added 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. and removed 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 Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Browser proof for fd4d6b1391e5cea2b4083b36d659d4315be4966c passed through the real Control UI with the canonical mock preview server and isolated Chromium. All six changed production-file hashes match the verified browser candidate.

A synthetic 503 with Retry-After: 1 followed by SVG success recovered the mounted icon in exactly two requests. Navigating to Plugins disconnected another pending icon; injecting a late update through its existing requestUpdate() API produced zero detached retries. Reopening the session made one fresh request and displayed the recovered icon. No browser errors were recorded.

The embedded browser pane remained hidden and did not finish startup, so this proof used visible-page isolated Chromium. The four screenshots below were inspected and contain only synthetic fixture data: initial fallback, connected recovery, navigation away with no retry, and reopened recovery. The original hosted failure did not record its third URL; the controlled pre-fix lifecycle test separately reproduced the same three-fetch assertion failure.

Mounted icon fallback after synthetic 503

Mounted icon recovered after one retry

Plugins navigation disconnects the pending icon without another retry

Reopened session displays its recovered icon

@steipete

Copy link
Copy Markdown
Contributor Author

Real-browser proof for the avatar lifecycle CI repair

Verified the candidate UI production sources at fd4d6b1 in isolated Chromium against the canonical dev:ui:mock server. This was the real Control UI with synthetic Gateway data and controlled image HTTP responses; no operator state or running Gateway was used.

Observed:

  • A mounted workspace icon received 503 with Retry-After: 1, then a valid SVG response. It made exactly two requests and visibly changed from the folder fallback to the fetched icon.
  • Normal UI navigation from a chat to Plugins disconnected another icon. A late update was injected through that real component's existing requestUpdate() API after disconnect, exercising Lit's permitted late-update behavior. Across the next 1.2 seconds it made zero retry requests.
  • Reopening the chat made one new request and displayed the recovered icon. The fix does not disable normal recovery or reconnection.
  • No browser page errors occurred. The six changed production-file hashes matched the reviewed lifecycle patch.

The queued-render-before-disconnect ordering is separately covered by the deterministic regression: on pre-fix code it produced requests in the order recovering, previous, recovering, reproducing the three-fetch assertion failure. Historical CI did not capture its third URL, so this is evidence of the confirmed lifecycle defect and the same failure pattern, not a claim that the historical caller was retrospectively identified.

The images below show the candidate's connected fallback, successful recovery, actual navigation away, and reopened chat. They are runtime flow states, not fabricated before/after mockups. All four captures were inspected and contain synthetic-only data. The embedded preview pane remained hidden and stalled startup, so the browser proof used visible-document headless Chromium against the same preview server instead. The task-owned browser and server have been stopped.

The Doctor diagnostic code and its fail-closed migration/runtime behavior remain unchanged by this CI follow-through. Required exact-head CI is still a separate merge gate.

Synthetic Control UI: folder fallback while the icon route recovers

Synthetic Control UI: project icon recovered after exactly two requests

Synthetic Control UI: navigation disconnected the icon and no retry occurred

Synthetic Control UI: reopening the chat reacquired its icon once

@steipete

Copy link
Copy Markdown
Contributor Author

Immediate-reconnect finding repaired and browser-verified

Addressed the ownerless-503 finding in the latest review. The failed response now deletes an unowned entry rather than retaining a miss with no retry or cooldown. Reconnection therefore acquires a fresh request. This is a condition refactor with zero net production growth; the new regression failed before the fix with one request instead of two, then passed with the other 57 focused tests. UI build, changed checks, and fresh Codex autoreview (P0 scope) passed.

Verified candidate fd325ec3 in isolated Chromium against the real Control UI and canonical synthetic mock server. For this narrow race, the probe held delivery of the first real HTTP 503/Retry-After: 1 response, detached the actual mounted workspace-icon element, delivered the response, then reattached the same element before the next timer task. Native DOM lifecycle, the shared loader, abort handling, the second HTTP fetch, and browser image decoding were not mocked. This is controlled response/lifecycle fault injection, not a claim that ordinary manual navigation reproduced the timing.

The observed order was host-disconnected → 503-delivered → request-aborted → 503-settled → same-host-reconnected. Exactly two requests total occurred (initial failure plus one reconnect request), and the recovered image decoded and appeared in the real header. Both captures below were inspected and contain only synthetic fixture data: first the pending fallback, then the recovered icon after immediate reconnect.

The previous browser flows were also rerun on this final source: mounted recovery used two requests; actual navigation to Plugins plus a late disconnected render produced zero retries; reopening used one new request and displayed the icon. All six production-file hashes matched, with no browser page errors or preview-server errors. Task-owned browsers and the preview server have been stopped. Exact-head required CI and native preparation remain separate landing gates.

Pending workspace icon before the immediate reconnect

Recovered workspace icon after same-task reconnect

@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: 🦐 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 Aug 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts and removed agents Agent runtime and tooling labels Aug 31, 2026
@steipete
steipete force-pushed the steipete/admiring-williamson-39fb9d branch from 32c9359 to d2c51d0 Compare August 31, 2026 14:54
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Aug 31, 2026
@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. 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. labels Aug 31, 2026
@steipete
steipete force-pushed the steipete/admiring-williamson-39fb9d branch 2 times, most recently from fd485c4 to a95e15e Compare August 31, 2026 16:19
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 31, 2026
@steipete
steipete force-pushed the steipete/admiring-williamson-39fb9d branch from a95e15e to ad59723 Compare August 31, 2026 16:41
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Final landing evidence for 4ac68682a089bf279ba6fcf889ac6e899162352f.

Doctor now identifies one safe malformed legacy field without exposing policy values or changing the strict schema, receipts, source preservation, or runtime approval gate. The maintainer accepted the combined avatar lifecycle and browser inventory repairs encountered during required CI follow-through. Thanks @sercada for the original report; the historical nullable-metadata migration is already covered by #118282.

The final isolated dist-backed flow used the normal runtime build at ad59723dfd7fc8d3392dfbaecf5b9aecc09421d5, with both build stamps verified. It produced the bounded diagnostic agents entry #2.allowlist[1].lastUsedAt: expected a finite number, preserved exact bytes, and leaked no private markers. Malformed Doctor exited0 with its warning; approvals get exited1. Changing only that field to0 allowed import, source retirement, and get0. Current upstream #133773 deliberately made this Doctor warning nonfatal; the maintainer accepted that contract. The old harness's exit1 from expecting Doctor1 remains recorded separately. The later commit adds only three E2E fixture lines; runtime/build inputs are unchanged. All synthetic state was cleaned.

Final fixture commands passed:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-flow.streaming.e2e.test.ts
node scripts/check-changed.mjs -- ui/src/e2e/chat-flow.streaming.e2e.test.ts
git diff --check

All12 streaming cases passed. The prior UI shard failed because the working indicator predates the deferred tool projection: Playwright retained a bubble that detached during scrolling. Both viewport probes reproduced that owner transition; the fixture now waits for the actual tool card before selecting its touch target. No production code, assertion, deadline, retry policy, or configuration changed. Fresh Codex autoreview was scoped-clean at default P0, following the whole-branch review. The broader diagnostic, avatar, browser, cancellation, and Linux proof is in the PR body and linked browser evidence.

ClawSweeper's latest reviewed code has no actionable findings. Its rank-up requests are addressed: maintainer scope acceptance is recorded, and installed Zod4.4.3 union/error source was inspected directly. Runtime +195/-77 (net118), tests +565/-251 (net314), docs+4, tooling0 across19files. Duplicate lint, Gateway, prompt and focus repairs are upstream-owned and absent from this PR.

Historical hosted extra-fetch/CDP/pointer ordering and lint shutdown kernel cause remain unknown; controlled reproductions do not claim those exact historical traces. Prior remote proof leases are stopped. The interrupted full build on a superseded head is not claimed as completed.

Exact-head CI33416971947 completed successfully:184 successful jobs and13 intentional skips. Workflow Sanity33416972078 passed. OPENCLAW_TESTBOX=1 scripts/pr prepare-run 133952 returned0 with exact-head gate selection, no source/head change and no extra push. Native prepared head remains 4ac68682a089bf279ba6fcf889ac6e899162352f. Final prepared-head merge approval is still pending.

@steipete
steipete merged commit 7019b35 into main Aug 31, 2026
258 checks passed
@steipete
steipete deleted the steipete/admiring-williamson-39fb9d branch August 31, 2026 17:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
…#133952)

* fix(doctor): identify malformed legacy exec approval fields

* fix(ui): release avatar routes with their hosts

* fix(ui): recover ownerless avatar misses on reconnect

* fix(browser): fence stale inventory publication after tab creation

* test(scripts): wait for process readiness before cancellation

* test(ui): scope reconnect responses to workspace icons

* test(ui): establish mobile metadata rest state

* test(ui): wait for tool projection before held touch
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 docs Improvements or additions to documentation extensions: browser 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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