Repository navigation
fix(ui): harden workspace file editing - #104885
Conversation
…-draft-retention # Conflicts: # CHANGELOG.md
|
Land-ready proof for the current PR head:
Known gap: the filesystem CAS contract protects OpenClaw writers and detects stale content before write; as documented in #104757, arbitrary external writers still have the normal final-syscall race window. |
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 10:22 PM ET / July 12, 2026, 02:22 UTC. Summary PR surface: Source +113, Tests +290, Docs +3, Other +5. Total +411 across 13 files. Reproducibility: yes. The pre-patch source clearly permits the reported draft-loss, unknown-capability, alias-concurrency, malformed-hash, and surrogate-encoding paths, and the branch adds focused regressions for them; I did not independently run the interactive UI flow. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Preserve the centralized update primitive and canonical draft identity, refresh the branch or merge review against current main, and add a short redacted real-browser recording showing a draft surviving navigation, Markdown editing, and a stale-save conflict before merge. Do we have a high-confidence way to reproduce the issue? Yes. The pre-patch source clearly permits the reported draft-loss, unknown-capability, alias-concurrency, malformed-hash, and surrogate-encoding paths, and the branch adds focused regressions for them; I did not independently run the interactive UI flow. Is this the best way to solve the issue? Yes. One canonical filesystem update primitive plus one canonical, scoped in-memory draft store is the narrowest maintainable fix and avoids per-route locks or duplicated component state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4eb1f5225c5f. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +113, Tests +290, Docs +3, Other +5. Total +411 across 13 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
* fix(ui): retain unsaved workspace file drafts * fix(ui): reset restored draft hash * fix(ui): keep all unsaved file drafts * fix(ui): harden workspace file editing * fix(ui): canonicalize workspace file identity * fix(gateway): serialize workspace file saves globally * chore: keep release notes in PR body * docs: refresh generated docs map
What Problem This Solves
The shared Control UI session workspace file editor landed in #104757, but several hardening gaps remained: unsaved drafts disappeared during navigation, Markdown bypassed the editor, edit capability detection was permissive, and concurrent saves could accept one stale hash through alternate file routes.
Follow-up to #104757 and #104698.
Why This Change Was Made
operator.adminand explicitly advertisessessions.files.set.User Impact
Workspace files in the shared Chat session detail sheet can be edited more safely: drafts survive file/panel/session navigation, do not leak across Gateways or panes, Markdown is editable, and concurrent or stale saves fail with a conflict instead of silently overwriting newer content. Read-only and older Gateways remain read-only.
Evidence
tbx_01kx9zc1a6mtayd31efzyxa3k0/ Actions run 29175453736: 56 gateway assertions and 62 UI assertions, including 9 Chromium editor tests.tbx_01kx9zrrhnb1nhjvscfssfb229/ Actions run 29175625303: final 58 gateway assertions, including lexical-alias and nested-root concurrency regressions.tbx_01kxa0az0cwdzxycd893vevqpn/ Actions run 29175869485: exact-headpnpm check:changedgreen across typechecks, formatting, core/UI/packages/scripts lint, dependency and policy guards, and runtime import cycles.file-editor-viewchunk (46.44 kB), preserving lazy loading.AI-assisted implementation and validation by Codex.