Repository navigation
fix: keep /pair qr images visible in Control UI - #172806
Conversation
Retain live pairing media on the same admitted assistant row when canonical history replaces its text. Keep setup secrets out of browser disk snapshots and preserve existing expiry rendering and channel delivery. Add refresh-order, identity-isolation, and cache regressions.
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c654861555
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4f4471a9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9df603c261
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR preserves live pairing QR images through history refreshes while retiring them on connection changes and excluding them from browser storage. Example: Run
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a current Control UI defect, and the earlier cache-restoration finding is fixed without introducing another actionable defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI reconciles live Gateway replies with canonical history, publishes the resulting transcript to its renderer, and saves sanitized browser snapshots. flowchart TD
A[Live Gateway reply] --> C[Session projection]
B[Canonical history] --> C
C --> D[Chat renderer]
E[Connection and account lifecycle] --> C
C --> F[Snapshot sanitizer]
F --> G[Browser storage]
Technical reviewBest possible solution: Retain pairing media within the existing scoped projection and sanitize both snapshot writes and restoration through the existing storage owner. Do we have a high-confidence way to reproduce the issue? Current-main terminal suppression and text-only history replacement explain the lost image; supplied before/after browser captures demonstrate the same scenario, but no target code was executed during this review. Is this the best way to solve the issue? The repair uses existing projection, presentation-scope, and snapshot owners, preserves canonical text and removal authority, and resolves the prior findings without a competing state store. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 520302d8ee63. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +161, Tests +316, Docs +7. Total +484 across 12 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 15, 2026, 2:11 AM ET / 06:11 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* fix: keep pairing QR images visible in Control UI Retain live pairing media on the same admitted assistant row when canonical history replaces its text. Keep setup secrets out of browser disk snapshots and preserve existing expiry rendering and channel delivery. Add refresh-order, identity-isolation, and cache regressions. * fix: retire pairing QR state with its connection * fix: bind pairing QR retention to the authenticated owner * test: complete pairing QR reconnect fixture * fix: discard persisted pairing QR credentials on restore
Fixes #172713
What Problem This Solves
Fixes
/pair qrshowing pairing instructions without a QR image in Control UI after chat history refreshes.User Impact
Users can scan the QR alongside the unchanged pairing details. The existing expiry notice still applies, and the setup secret stays out of both the transcript and the browser's disk cache. Reloading, reconnecting, or changing authentication requires generating a fresh code. Other channels are unchanged.
Why This Change Was Made
The command and Gateway already produce the QR attachment. Its live reply shares the persisted message's identity, but history deliberately contains only the text. Control UI was replacing the live attachment with that text-only row, or discarding a late QR reply after history arrived first.
The existing projection publication owner now retains only the QR block for the same admitted native assistant identity. Canonical history continues to own text, metadata, and removal; session, agent, and lifecycle changes do not inherit the image. Logical reconnects, canonical authenticated-owner changes, authentication changes, and pane disposal retire the QR from the existing projection and QR-bearing memory snapshots, preserving ordinary history and run state. Rendering and channel delivery are unchanged. One shared QR sanitizer serves disk serialization and snapshot restoration, including
openclawDisplayContent. Older version-2 snapshots lose QR credentials before hydration and are scheduled for a sanitized rewrite through the existing writer; ordinary text, images, identity, metadata, and pagination survive.Production delta is +168/-7 (net +161); tests +318/-2; docs +7/-0. The positive production delta implements the missing live-media retention, connection-owned retirement, and shared disk-cache sanitization/upgrade repair; there was no superseded owner path to delete without unrelated cleanup.
Evidence
02f05b5915ecb23cd547f898074a6d9562fa281f, including all three UI shards (cache-upgrade and rendered-retirement regressions), UI E2E, production/test typechecks, lint, docs, performance, selected Node shards, boundary/baseline checks, andopenclaw/ci-gate. No failed-job rerun was needed. Final-head GitHub code review completed without new findings; the P2 cache-upgrade thread has a repair reply and is resolved./pair qr, receive the live image, publish the same persisted assistant row, and refresh history. Before: 0 QR images. After: 1 QR image. Pairing text is unchanged. Local image decoding found exactly one QR matching the nonfunctional synthetic payload.keeps the live pairing QR through history refreshes (history first=%s);does not transfer a pairing QR across a different %s identity;keeps pairing QR credentials in memory without writing them to the browser cache;retires pairing QR credentials on %s without losing canonical history;restores and rewrites pre-sanitizer snapshots without pairing credentials (%s). These cover both arrival orders, repeated snapshots, history deltas, authoritative removal, identity/scope isolation, reconnect/auth/profile/disposal retirement, rendered QR removal before and after subsequent history, direct/prewarmed restoration of old version-2 records, sanitized disk rewrite, and raw disk serialization without changing live in-memory media.git diff --check, and deslop passed. Codex autoreview: scoped-clean, no actionable P0–P2 findings (code review only).loadAssistantIdentitywas missing). The fixture now supplies the same stub used by sibling reconnect tests; assertions remain unchanged.Capture and deferred-write details
Capture uses the repository mock-Gateway and screenshot helpers, with a standalone Playwright assertion adapter; no test runner or real Gateway is started:
TMPDIR=/private/tmp/oc-r8-pairqr node --import tsx \ --import ./.artifacts/pair-qr-screenshot-assertions.mjs \ .artifacts/pair-qr-screenshot.mts before # or afterRead repair carries the admitted Gateway/account/session cache key and a sanitized immutable historical snapshot. The read owner checks its current key revision and database generation after awaited storage access, before scheduling repair. Repair uses the existing writer: invalidation clears pending work, and flush checks current per-key revisions and database generation before writing. The snapshot retains its historical session/metadata facts; the write owner assigns the new saved-at time. Database/store names, configuration, and bounds remain process-stable constants. No new cleanup writer or authority owner is introduced.