Repository navigation
fix: preserve archived transcript symlink selection - #200505
Conversation
Restore the ordinary fs-safe path semantics lost in #200461 without moving filesystem work back onto the caller. Reuse the existing realpath worker; cover indirect links and actual usage totals. Co-authored-by: RomneyDa <[email protected]>
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR restores ordinary symlink resolution for asynchronous archived-transcript reads using the existing realpath worker. Example: main/sessions/alias.jsonl targets link/../record.jsonl, and link targets worker/sessions/child.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current-main transcript-selection regression, and source review found no introduced correctness defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe archived-usage reader converts a saved transcript filename into filesystem candidates, streams the selected file, and returns aggregated usage. flowchart TD
A[Archived usage request] --> B[Transcript candidate planner]
B --> C[Shared session path policy]
C --> D[Existing realpath worker]
D --> E[Ordinary filesystem resolver]
E --> F[Selected transcript]
F --> G[Usage accumulator]
Technical reviewBest possible solution: Run the existing ordinary canonicalization contract in the existing worker so archived usage matches synchronous transcript selection without blocking the caller. Do we have a high-confidence way to reproduce the issue? Current-main source, the pinned dependency contract, and the concrete competing-transcript fixture establish the failure path; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch restores the established resolver through an existing worker owner, preserves executable semantics, and avoids a custom path walker or additional pool. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4c61c20fb1a7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +22, Tests +43. Total +65 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 Reviewed November 17, 2026, 3:52 AM ET / 08:52 UTC. |
Keep the shared path policy in the synchronous module and move worker-backed I/O to its async entry point. This removes the CI import cycle and wrapper source dependency without lazy-load synchronous filesystem work. Correct the parameterized test context typing. Co-authored-by: RomneyDa <[email protected]>
* fix: preserve archived transcript symlink selection Restore the ordinary fs-safe path semantics lost in #200461 without moving filesystem work back onto the caller. Reuse the existing realpath worker; cover indirect links and actual usage totals. Co-authored-by: RomneyDa <[email protected]> * fix(sessions): isolate asynchronous transcript path dependencies Keep the shared path policy in the synchronous module and move worker-backed I/O to its async entry point. This removes the CI import cycle and wrapper source dependency without lazy-load synchronous filesystem work. Correct the parameterized test context typing. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 62bb5d3)
* fix: preserve archived transcript symlink selection Restore the ordinary fs-safe path semantics lost in openclaw#200461 without moving filesystem work back onto the caller. Reuse the existing realpath worker; cover indirect links and actual usage totals. Co-authored-by: RomneyDa <[email protected]> * fix(sessions): isolate asynchronous transcript path dependencies Keep the shared path policy in the synchronous module and move worker-backed I/O to its async entry point. This removes the CI import cycle and wrapper source dependency without lazy-load synchronous filesystem work. Correct the parameterized test context typing. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Archived usage reads can select another agent's transcript when a saved transcript path contains an indirect symlink whose target includes
... The async resolver introduced in #200461 follows native symlink semantics, unlike the previous ordinary resolver. This addresses the concrete P2 reported on that PR; the finding was not resolved before merge.User Impact
Restores the prior transcript selection and usage totals while keeping filesystem canonicalization off the caller's thread. No configuration, authorization, retention, or database-policy changes. The separate xAI session-authorization repair is #200510.
Why This Change Was Made
Reuse
safeRealpathSync, the existing canonicalization contract, inside the existing realpath worker. Ordinary resolution normalizes parent segments within each expanded symlink before following other links; native realpath can select a different file. The existing executable-resolution operation retains its physical-path behavior. The tradeoff is worker dispatch for async transcript canonicalization.The asynchronous adapter now has its own
paths-async.tsentry point. Synchronous path callers retain the existing lightweight module, while both adapters consume the same path-policy generator. This removes the static import cycle and keeps execution-worker dependencies out of the PR wrapper's source closure. A lazy-import attempt was rejected because the unchanged no-sync assertion caught a coldstatSync; there is no prewarming, runtime-recovery change, authority-type extraction, new pool, or custom path walker. The parameterized filesystem test usestest.forso its skip context is typed correctly.Evidence
agents/main/sessions/record.jsonl, receivedagents/worker/sessions/record.jsonl; the synchronous resolver selects the expected file.The CI failures on the original PR head are retained as regression evidence, not dismissed as flakes. No guard, assertion, dependency version, or shared installation was weakened to obtain the corrected results.