Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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. |
|
|
Codex review: needs maintainer review before merge. What this changesRetain session-file authority independently of display-cache residency and forward committed snapshot facts through existing publication owners. Example: Download preview.html after unrelated session reads evict its cached row.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a source-confirmed cache-eviction failure while preserving live workspace and reader-policy checks; no actionable patch defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway file, diff, and form-resource handlers consume session facts published by database and memory owners, then enforce current session and caller authority before filesystem access and HTTP disclosure. flowchart LR
A[Session writers] --> B[Committed publications]
B --> C[Retained entry predicate]
D[Gateway file request] --> C
C --> E[Workspace and reader checks]
E --> F[File response or retained download]
Technical reviewBest possible solution: Keep file authority in the existing retained predicate owner and preserve live revocation checks through HTTP delivery. Do we have a high-confidence way to reproduce the issue? Current main contains the evictable-reader failure path, and the supplied baseline reproduction identifies FORBIDDEN previews and 404 downloads after actual LRU eviction; this read-only review ran no target code. Is this the best way to solve the issue? The patch repairs the lifetime mismatch using an existing authority owner, removes duplicate cache-based checks, and carries snapshot evidence across affected publishers without new storage or configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 36b28bb0f51d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +61, Tests +257, Docs +5. Total +323 across 33 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 (3 earlier review cycles)
Reviewed October 20, 2026, 4:35 AM ET / 08:35 UTC (Revision 4). |
cd66d6c to
47855e9
Compare
|
@clawsweeper re-review Corrected the stale file test fixtures exposed by CI: matching runtime configuration and real persisted session facts now supply retained authority. File-policy tests: 41 passed / 1 platform skip; repository tests: 16 passed. No production change in the correction; independent review is clean through P2. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Final HTTP disclosure proof on Command: The worktree case forces actual replica LRU eviction, serves the retained grant, then changes the worktree ID. The sandbox case admits the read-only role, serves its retained grant, then changes that role to require a sandbox before fetching the same URL. Both denied responses are asserted not to contain the protected fixture bytes. This is in-process Gateway admission plus actual HTTP delivery, not a claim of a separate WebSocket process proof. |
47855e9 to
d5f68bb
Compare
|
@clawsweeper re-review The final HTTP proof is in the body and the captured trace: permitted downloads return the expected bytes, while the same grant returns 404 after either a workspace change or a newly forbidden reader role. The remaining heartbeat CI timeout now has a focused fixture correction using the repository's existing |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
CI run 39390399994 on d5f68bb has two independently reproduced baseline failures:
No CI reruns were requested. The PR body includes the regression, real Gateway/HTTP revocation proof, focused checks, and independent reviews. |
A metadata publication between the two worker-read batches can refresh the selected row, leaving it resident before the fixture reaches revocation. Install the unchanged sibling rows returned by the worker as one cache-owner batch, and retain the metadata interleaving as regression coverage. Keep the exact cache-miss, HTTP content, and revoked-download assertions. Follow-up to the eviction coverage added in #178173.
…law#178173) * fix(gateway): retain workspace authority across session cache eviction * test(gateway): use live session file authority in fixtures * test(gateway): prepare heartbeat runtime before behavior timing
A metadata publication between the two worker-read batches can refresh the selected row, leaving it resident before the fixture reaches revocation. Install the unchanged sibling rows returned by the worker as one cache-owner batch, and retain the metadata interleaving as regression coverage. Keep the exact cache-miss, HTTP content, and revoked-download assertions. Follow-up to the eviction coverage added in openclaw#178173.
What Problem This Solves
Under many-session load, file previews, downloads, and session diffs can incorrectly fail with “Session workspace changed during file access.” The file authority reader consulted the evictable actor replica; unrelated reads could evict the row and make an unchanged workspace appear revoked. A 5,000-session streaming Gateway stress run reproduced this through
sessions.diff.User Impact
File access remains available when unrelated session reads evict display rows. Real workspace, library-selection, session-generation, and sharing changes still revoke access, including an already-issued download URL. Sandbox and host-workspace checks remain in place.
Why This Change Was Made
Use the existing retained session-entry predicate owner for file authority, then borrow that same current-entry reader for form uploads and file operations. HTTP delivery borrows the download grant's longer lifetime. Delete the duplicate cache-based authority reader and worktree-settlement reread.
Snapshot-dependent predicates need the full committed entry, whereas display consumers need list projections. Carry the full postimages already produced by native writes, worker receipts, recovery, actors, and transcript writers to the existing predicate owner. Do not add SQL reads, caches, a schema change, or configuration. Missing required snapshot evidence refuses the read; ordinary title, participant, and transcript updates preserve it.
Production delta: +186 / −125 = +61 lines. The deleted file-specific authority path is smaller; the remaining growth carries selected-snapshot evidence across the existing publishers so the repair preserves revocation instead of treating incomplete list rows as complete facts.
Evidence
FORBIDDEN; an issued download returns 404 after eviction. The same tests pass with the fix, and a real workspace change still revokes the download.47855e9228333d864a59b0ee670cca7ef04d00af(runtime patch unchanged on the current head): allowed after replica eviction 200 with<h1>boo</h1>\n; same URL after workspace revocation 404 / Not Found. A read-only role received 200 with synthetichost private bytes; after its role became sandbox-required, the same URL returned 404 / Not Found, without protected bytes. Real Gateway admission, persisted entries, and loopback HTTP delivery; 5 tests passed across the worktree and sandbox files. Temporary observation-only prints were removed after capture.No allocation reduction is claimed. The earlier long stress run failed before producing a valid baseline; promotion, GC, and latency acceptance measurements remain separate work. Broad checks run in PR CI. No Testbox lease was allocated.
CI history and fixture correction
On head
47855e9228333d864a59b0ee670cca7ef04d00af,worker-turn-launcher.test.tsreports 33 passed / 1 failed at the stale-local-finally case: durable restart cleanup returns 0, while the test expects 1. The exact unchanged main parent8fb3a2007922d5d73a3c72be6a8062aca073c72cproduces the same result and assertion. The baseline run used the same worktree with the complete PR patch removed and its tracked tree verified equal to that pinned parent, then restored the patch. Upstream #178098 moved local claims to memory; this test still expects a durable row. This PR changes neither that test nor the placement claim owner.The heartbeat Gateway restart case timed out at 90 seconds on that CI head. Its first
server-startmodule evaluation consumed 13.74 seconds inside the behavior budget; the second import took 1.1 ms. Two-core/8 GB isolated Linux reproduction passed on both head and pinned parent (28.1 / 13.9 seconds initially; warmed head 14.1 seconds), so a passing replay was not used to declare the failure inherited.The fixture now follows the existing Gateway-test convention: prepare
server-startinbeforeAllbefore starting the behavior timer. Both real Gateway starts, the catalog-owner restart, all route/delivery assertions, and the 90-second timeout remain unchanged. Focused corrected case passed in 16.0 seconds; formatting, lint, and independent review are clean. The shared hook timeout is 180 seconds, unchanged. This addresses a demonstrated timeout contributor; PR CI validates the new head. No CI rerun was requested.On exact PR head
d5f68bba59a10280dc1fe51dcee2cb49fac286c6, CI run39390399994, job118520893189failedsrc/gateway/x-publication-owner-composition.e2e.test.tsat the anonymous public read (line 919): expected HTTP 200, received HTTP 503 with “This conversation is temporarily unavailable. Please retry.” The same single file on the exact unchanged PR parent40ecdd3e3b82reproduced the identical assertion and response. The pinned PR head passed. Both runs used the same isolated Linux sandbox, two CPU cores and 8 GB memory, with the complete PR patch reversed for baseline and restored afterward. This establishes the failure as inherited; the public representation cache/admission/read path is unchanged. No CI rerun was requested.The same inherited worker-placement assertion recurred on
d5f68bba59a10280dc1fe51dcee2cb49fac286c6in job118520893299of run39390399994. The test and placement owner are byte-identical between the proven baseline above and this head; the other seven files in that job passed (134 passing tests overall).Final CI disposition
Exact-head CI run
39390399994completed ond5f68bba59a10280dc1fe51dcee2cb49fac286c6. The only failed test jobs are the two inherited failures documented above; all remaining test jobs passed. The aggregate CI gate reflects those failures. Security-sensitive and dependency review gates passed, and the latest exact-head independent review has no actionable findings. Land under the standing inherited-failure exception; no CI reruns were requested.