Repository navigation
fix(agents): preserve workspace ownership across path aliases - #130372
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Exact-head landing verification: Share the bounded workspace symlink traversal for lookup and deletion, preserving filesystem Unicode bytes; remove duplicated canonicalizers and dreaming roster normalization. Production +26/-72 (−46); tests +110/-1 (+109). Three original baseline failures reproduce alias-roster and dangling-workspace errors. Final142 local tests and98 actual Linux tests pass, including distinct NFC/NFD inodes and correct routing/deletion. Full matching changed gate, P1 and independent exact-head source/proof review pass. Hosted CI is green for 2296f3f. Best-fix judgment: Direct existing-ancestor realpath loses dangling symlink targets; sharing the persisted normalized key incorrectly merges distinct Linux Unicode paths. The bounded walker with an identity transform is the correct owner. Limitations: Persisted state keys retain their existing normalization. The pre-existing stored NFC-key collision needs separately approved storage/migration design; this PR does not claim to fix it. Latest available ClawSweeper comment is a review-start placeholder, without an actionable rank-up list; independent final-source review is complete. No new config, dependency, protocol or database schema is introduced. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 4:29 PM ET / 20:29 UTC. ClawSweeper reviewWhat this changesCentralizes workspace-path canonicalization so agent lookup and deletion safety follow dangling symlink aliases while retaining separate persisted state identity rules. Merge readinessKeep this active maintainer PR open. The exact head contains a coherent owner-boundary fix for dangling workspace aliases, but current-main comparison and the later PR comment could not be fetched because the shallow checkout lacks those objects and GitHub DNS was unavailable. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherAgent workspace configuration feeds routing, deletion safety, and memory dreaming. These paths resolve an agent owner before selecting sessions, cleaning files, or scheduling workspace work. flowchart LR
A[Agent configuration] --> B[Workspace resolver]
B --> C[Canonical filesystem path]
C --> D[Agent routing]
C --> E[Deletion safety]
A --> F[Dreaming roster]
F --> G[Workspace scheduling]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -46, Tests +109. Total +63 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared filesystem-path walker, retain NFC normalization only for persisted state identities, and complete exact-head CI plus a refreshed current-main review before merging. Do we have a high-confidence way to reproduce the issue? Yes, from source: a dangling symlink makes direct realpath fail, whereas the shared walker follows its lexical target before ownership comparison. The read-only review did not run tests because they create temporary filesystem artifacts. Is this the best way to solve the issue? Yes. Sharing the bounded walker removes duplicate ownership policy while preserving the distinct persisted-state normalization contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 38966daa3316. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Workspace lookup and agent-deletion safety each used a private realpath-or-lexical fallback. A dangling symlink lost its target identity: lookup could miss the owning agent, and deletion could miss another agent sharing the vanished workspace. Dreaming separately retained duplicate roster aliases already normalized by agent configuration.
Why This Change Was Made
Reuse the existing bounded workspace symlink walker for filesystem ownership, removing both duplicate canonicalizers and the separate dreaming roster loop. Share traversal, not stored-key normalization: filesystem paths preserve Unicode bytes, while persisted state-key normalization stays exactly where it was. There is no schema, hash, alias, or stored-data migration.
Production LOC: +26/-72 (net -46). Tests: +110/-1 (net +109).
User Impact
Workspace ownership and shared-workspace deletion protection follow dangling symlink targets correctly. Distinct Linux NFC/NFD directory names remain distinct for routing and deletion. Dreaming processes canonical agent identities once.
Existing persisted state keys still NFC-fold those names; repairing that separate storage identity needs an explicit migration/design decision and is not part of this PR.
Evidence
2296f3f6cb232ae61956a22077a083eeb5718153.Maintainer-requested, AI-assisted. Required exact-head hosted CI and native landing checks remain mandatory.