Skip to content

test(gateway): canvas reads keep verified cold archives after #185955 - #186193

Merged
steipete merged 2 commits into
mainfrom
steipete/fix-canvas-cold-read-test-20261027
Oct 27, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/fix-canvas-cold-read-test-20261027

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Main is red. src/gateway/server-methods/canvas-session-read.test.ts > reads retained widget receipts and waits only for current live presentations fails with expected { session_id: …, … } to be undefined.

A bisect between r240 (7bce7a61, where the test passes) and main pins the first bad commit at 35494b66, "perf(sessions): avoid cold restores for transcript probes" (#185955). That change intentionally made read-only transcript probes consume verified cold archives without restoring them, so reading an archive no longer moves it back into hot storage. The canvas view still returns identical content, and that assertion passes. The test then asserted the old side effect: the cold archive was gone after the view.

This PR asserts the new contract instead: after a read-only view, the archive is still present and the view content is unchanged. Production code is unchanged.

Evidence

  • On main, the test fails at the archive assertion. The same failure shows up on unrelated PRs, e.g. perf(sessions): reuse branch summaries across unrelated writes #186127, job checks-node-changed-compact-small-2-2.
  • With this change, node scripts/run-vitest.mjs src/gateway/server-methods/canvas-session-read.test.ts passes: 1 file, 1 test.
  • Bisect: git bisect run over 7bce7a61..bf72e96b39a2 with --first-parent reports 35494b66 as the first bad commit.

#185955 made read-only transcript probes stream verified cold archives
instead of restoring them. The canvas retained-widget test still asserted the
old restore side effect (archive gone after a view), so it failed on main.
The view still returns identical content; assert the archive stays cold.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T18:15:48.344360Z 8762bad PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 27, 2026
#185955 made loadTranscriptEvents stream verified cold archives instead of
restoring them, so the carrier-retirement test waited forever for a restore
mutation that read-only probes no longer start (300 s CI timeout on main).
Trigger restoration through restoreSessionColdTranscript, then read.
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR changes the canvas integration test to expect a verified cold archive to remain present after viewing its saved widget.

Example: A conversation reader opens the saved widget in the archived widget-parent session.

  • Before: The test expects the archive to disappear, despite receiving the correct widget content.
  • After: The test checks that widget content is unchanged and the archive remains present.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The assertion matches the intended production contract, with integration-test support, but a small diff-caused required-check failure remains.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored assertion-only repair changes no shipped behavior; its reported focused run and passing exact-head test shard support the existing production-path harness.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: An obsolete canvas assertion makes CI fail even though archived widgets return the expected content.
Reason: The maintainer-authored repair follows the merged cold-read direction and retains the original saved-widget access checks.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR: it correctly updates an obsolete archive expectation, but its added comment triggers the required test-line ratchet.

Priority: P2
Reviewed head: 8762bad071ad972c5c91974c770e7e355ece8786

Before merge

  • Keep the assertion repair within the test-line ratchet (P2) - The added comment makes this PR add one test line while the tree is already above its ceiling. The required checks-fast-baseline-ratchets job reports test-lines failed, and scripts/check-test-lines-ratchet.mts rejects positive deltas in this state. Make the change line-neutral, for example by omitting the added comment, while retaining both archive and widget-content assertions.

Findings

  • [P2] Keep the assertion repair within the test-line ratchet — src/gateway/server-methods/canvas-session-read.test.ts:205
Agent review details

How this fits together

The Gateway canvas handler verifies a saved widget receipt through the session transcript owner, then returns the document HTML under current conversation access.

flowchart LR
  A[Conversation reader] --> B[Canvas view handler]
  B --> C[Session receipt matcher]
  C --> D[Verified cold archive]
  B --> E[Saved document owner]
  E --> F[Widget HTML response]
Loading

Technical review

Best possible solution:

Keep the corrected archive assertion and make this focused test repair line-neutral without removing behavioral checks or raising the ceiling.

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

Current-main source shows that canvas-widget matching reads verified cold archives directly while the test still expects removal; the reported failure matches that mismatch, but no tests were run during this read-only review.

Is this the best way to solve the issue?

Changing this assertion is the smallest complete repair because the production behavior is intentional and widget-content equality remains independently checked.

Full review comments:

  • [P2] Keep the assertion repair within the test-line ratchet — src/gateway/server-methods/canvas-session-read.test.ts:205
    The added comment makes this PR add one test line while the tree is already above its ceiling. The required checks-fast-baseline-ratchets job reports test-lines failed, and scripts/check-test-lines-ratchet.mts rejects positive deltas in this state. Make the change line-neutral, for example by omitting the added comment, while retaining both archive and widget-content assertions.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c28d2e4294e4.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • node scripts/run-vitest.mjs src/gateway/server-methods/canvas-session-read.test.ts
  • pnpm check:test-lines-ratchet --base bf72e96 --no-merge-base
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 4d5bafa adds src/gateway/server-methods/canvas-session-read.test.ts:207 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4d5bafae552e; files: src/gateway/server-methods/canvas-session-read.test.ts)
  • Shakker: Raw commit a59c323 adds src/gateway/server-methods/canvas-session-read.test.ts:235 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a59c32370a2d; files: src/gateway/server-methods/canvas-session-read.test.ts)

PR surface

Tests +1. Total +1 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 2 1 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 1 +1

Labels

Label changes:

  • add P2: This focused repair restores a failing integration assertion to the intended contract; it changes no production behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This focused repair restores a failing integration assertion to the intended contract; it changes no production behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 27, 2026, 2:33 PM ET / 18:33 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Admin-merging over checks-fast-baseline-ratchets (and the ci-gate that rolls it up). The only failing step is test-lines: "over by: 20; net delta: +5", so 15 lines of that overage are inherited from main. The +5 belongs to the two repaired tests. This PR repairs two red main tests caused by #185955 and changes no production code. Every other check is green at 563c31b7902f.

@steipete
steipete merged commit 3d58b40 into main Oct 27, 2026
99 of 102 checks passed
@steipete
steipete deleted the steipete/fix-canvas-cold-read-test-20261027 branch October 27, 2026 18:53
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…w#185955 (openclaw#186193)

* test(gateway): canvas reads keep verified cold archives after openclaw#185955

openclaw#185955 made read-only transcript probes stream verified cold archives
instead of restoring them. The canvas retained-widget test still asserted the
old restore side effect (archive gone after a view), so it failed on main.
The view still returns identical content; assert the archive stays cold.

* test(sessions): restore explicitly in archive carrier retirement test

openclaw#185955 made loadTranscriptEvents stream verified cold archives instead of
restoring them, so the carrier-retirement test waited forever for a restore
mutation that read-only probes no longer start (300 s CI timeout on main).
Trigger restoration through restoreSessionColdTranscript, then read.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant