Skip to content

fix(gateway): preserve concurrent agent workspace file edits - #135865

Merged
obviyus merged 3 commits into
openclaw:mainfrom
yetval:fix/agents-files-set-cas
Sep 9, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
yetval:fix/agents-files-set-cas

Conversation

@yetval

@yetval yetval commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Saving an agent workspace file must preserve changes made after the editor opened it. The editor now refuses a stale Save and offers Reload or Overwrite. Reset also adopts the matching hash when it adopts refreshed text.

Evidence

The same real Gateway, served Control UI, Chromium, and separate workspace writer were used on pinned main 7c6ca652ef75c7bea81659879424551fabfdafe3 and the repaired candidate. Captures were inspected. Private fixture contents, workspace paths, credentials, and infrastructure details are omitted here.

Action Current-main result Repaired result
Open a 28-byte file; another writer changes it to 62 bytes; save a 46-byte stale draft Save returned success; disk became 46 bytes and lost the later edit Save returned agent_file_conflict; disk stayed 62 bytes and the draft remained in the editor
Save again without resolving Unconditional write Refused with the same original hash
Refresh a dirty draft, then Save Unconditional write Draft ancestry retained; later bytes preserved
Reload after conflict No explicit conflict recovery Current text and hash adopted together
Change disk again after conflict, then choose Overwrite No explicit conflict recovery Fresh get precedes conditional set using the newest hash
Dirty Refresh, Reset, edit, Save No conditional guard Refreshed text/hash adopted together; Save succeeds

Sanitized excerpts from actual file RPC frames use H0 for the original content hash and H1 for the later content hash. These are aliases, not literal request values:

main:      agents.files.set(content=<46-byte draft>) -> ok:true
main disk: 46 bytes; later edit absent
candidate: agents.files.get -> content=<28-byte base>, hash=H0
candidate: agents.files.set(content=<46-byte draft>, expectedHash=H0)
           -> ok:false, code=INVALID_REQUEST,
              details.type=agent_file_conflict, details.currentHash=H1
candidate disk: 62 bytes; later edit retained

An independent source-blind browser pass repeated the conflict/recovery cases with fresh values, checked real disk bytes and passive RPC frames, and also saved empty and Unicode content. It found no browser behavior failures. Source provenance, direct RPC controls, and landing gates were explicitly outside that validator's browser role and were checked separately.

Repair

  • Return optional content hashes and accept optional expectedHash on agent-file saves.
  • Compare and write inside the existing shared workspace update queue, including the session-file route.
  • Normalize permitted uppercase hash digits before comparison.
  • Keep draft ancestry across refused Save and dirty Refresh. Reload, Overwrite, and Reset transfer the appropriate matching hash.
  • Recheck the active client, capability, and request generation after Overwrite's awaited read.
  • Preserve current file admission, identity merging, session authority checks, and size policy. Regenerate the Swift protocol model without a protocol version change.

This retains @yetval's conditional-save repair and resolves the outstanding Reset review finding. The separate Refresh-cache repair associated with #127592 has already shipped; this PR does not close or replace that issue.

Validation

  • 139 focused Gateway and UI tests passed across eight files, including all five existing Chromium preview tests after completing their required fixture properties.
  • One existing real-Gateway Chromium test passed, including dirty Refresh → Reset → edit → Save; the unrelated catalog scenario was not selected.
  • The permitted uppercase form of an unchanged file hash saved successfully after a separate real-Gateway red/green correction.
  • Counterfactual regression proof: the uncorrected candidate failed Reset/hash plus three Overwrite retirement cases for their intended reasons.
  • Two authenticated Gateway clients: same-hash mutating saves produced exactly one success, both for agent/agent and agent/session writes.
  • Live RPC controls passed for legacy omitted-precondition overwrite/creation, missing and invalid input, unauthorized write, traversal, symlink/hardlink rejection, identity merging, session conditional writes, and existing distinct size policies.
  • Scoped formatting, lint, protocol generation, and keyless UI translation checks passed. Hosted CI supplies complete typechecks and platform lanes.
  • Earlier browser proofs remain valid for unchanged lowercase requests. A fresh native build and independent API/browser follow-up verified the final hash-case correction and stale-save recovery.

Missing-file creation races remain outside this repair: there is no expectedAbsent write precondition. Content hashes are not monotonic revisions. The process-local queue does not exclude an external writer changing bytes between comparison and publication, or writes from another Gateway process.

@clawsweeper

clawsweeper Bot commented Sep 2, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: M labels Sep 2, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 1:42 AM ET / 05:42 UTC (Revision 5).

ClawSweeper review

What this changes

Adds conditional agent workspace-file saves and explicit Reload/Overwrite recovery, preserving draft ancestry through Refresh and Reset.

Merge readiness

✅ Ready for maintainer review

This repair remains necessary: current main still permits stale agent-file saves. The earlier findings are resolved, the supplied real-Gateway evidence covers the repaired behavior, and no blocking defect was found.

Priority: P1
Reviewed head: c62a11624ab85b67954902edeeb831a7f660e6f7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported repair with the earlier findings resolved and no remaining blocking correctness concern.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured real-Gateway RPC and Chromium observations exercise the changed agent-file handler and editor recovery flow, showing stale writes refused, newer disk bytes preserved, and Reload/Overwrite/Reset recovery working.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured real-Gateway RPC and Chromium observations exercise the changed agent-file handler and editor recovery flow, showing stale writes refused, newer disk bytes preserved, and Reload/Overwrite/Reset recovery working.
Evidence reviewed 8 items Current main still needs the repair: The fetched main revision sends agent-file saves without a precondition and writes directly through workspaceRoot.write. Its existing refresh lifecycle protection does not reject external changes made after opening the editor.
Latest release retains unconditional saves: The v2026.9.3 source also writes agent files unconditionally at line 1523; this release does not contain the proposed conditional-save behavior.
Shared compare-and-write boundary: Agent-file hash comparison and publication now use the queue already used by session-file updates. Missing or mismatched files produce a conflict; uppercase hashes normalize before comparison, while omitted preconditions preserve the existing API.
Findings None None.
Security None None.

How this fits together

The Control UI edits agent instructions and memory files through Gateway file RPCs. The Gateway compares the editor’s content hash with disk contents before publishing a save through the shared workspace update queue.

flowchart TD
  A[Control UI draft and hash] --> B[Agent file save request]
  C[Session file saves] --> D[Shared workspace update queue]
  B --> D
  D --> E{Current hash matches?}
  E -->|Yes| F[Write workspace file]
  E -->|No| G[Keep draft and show conflict]
  G --> H[Reload or explicit Overwrite]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +257, Tests +494, Docs 0, Other +8. Total +759 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 10 297 40 +257
Tests 6 526 32 +494
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 9 1 +8
Total 18 833 74 +759

Review metrics

Metric Value Why it matters
Protocol compatibility 1 optional request precondition; 1 optional response hash; no version bump Existing RPC clients retain unconditional writes while the bundled editor gains conflict protection.
Implementation and regression coverage Net production +265 lines; tests and test support +494 lines Production growth implements conditional saves and explicit recovery, with coverage for the previously identified lifecycle failures.

Technical review

Best possible solution:

Keep conditional saves at the shared write boundary and pair each editor draft with its matching hash, with explicit conflict recovery and unchanged legacy RPC behavior.

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

Yes: open a file, change it through another writer, then save the original draft. Current-main source still permits the overwrite, and the supplied earlier-main runtime trace demonstrates it; this review did not execute current main.

Is this the best way to solve the issue?

Yes: reusing the existing write queue and carrying draft hashes fixes the reported stale-save path without changing file formats or legacy client semantics.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: Saving a stale agent instruction or memory draft can silently erase newer workspace edits on current main.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured real-Gateway RPC and Chromium observations exercise the changed agent-file handler and editor recovery flow, showing stale writes refused, newer disk bytes preserved, and Reload/Overwrite/Reset recovery working.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured real-Gateway RPC and Chromium observations exercise the changed agent-file handler and editor recovery flow, showing stale writes refused, newer disk bytes preserved, and Reload/Overwrite/Reset recovery working.

Evidence

What I checked:

  • Current main still needs the repair: The fetched main revision sends agent-file saves without a precondition and writes directly through workspaceRoot.write. Its existing refresh lifecycle protection does not reject external changes made after opening the editor. (src/gateway/server-methods/agents.ts, b04a3f83adad)
  • Latest release retains unconditional saves: The v2026.9.3 source also writes agent files unconditionally at line 1523; this release does not contain the proposed conditional-save behavior. (src/gateway/server-methods/agents.ts:1523, 1391f7cd2d40)
  • Shared compare-and-write boundary: Agent-file hash comparison and publication now use the queue already used by session-file updates. Missing or mismatched files produce a conflict; uppercase hashes normalize before comparison, while omitted preconditions preserve the existing API. (src/gateway/server-methods/agents.ts:1613, c62a11624ab8)
  • Previous findings resolved: The controller retains a dirty draft’s hash on Refresh and refused Save, pairs Reset with the refreshed base hash, and rechecks client, capability object, connection, and request generation after Overwrite’s read. Since the immediately preceding review, only the browser preview fixture gained its three required properties. (ui/src/pages/agents/files.ts:161, c62a11624ab8)
  • Real behavior evidence: The captured PR body reports real Gateway, served Control UI, Chromium, and separate disk-writer runs. Its redacted RPC excerpt shows the stale 46-byte draft rejected with agent_file_conflict while the later 62-byte disk contents survive. Recorded observations also cover repeated Save, dirty Refresh, Reload, Overwrite, Reset, uppercase hashes, and concurrent agent/session saves. The final commit changes only a test fixture, preserving the production behavior exercised by that evidence. No target code was executed during this review. (c62a11624ab8)
  • Regression coverage and bounded guarantees: The real-Gateway browser test checks disk contents after conflict, Overwrite, Reload, dirty Refresh, and Reset. The body explicitly excludes missing-file creation races, external writes between comparison and publication, and other Gateway processes; these are not newly introduced regressions. (ui/src/e2e/agent-file-lifecycle.real-gateway.e2e.test.ts:461, c62a11624ab8)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-02T03:45:18.233Z sha 75e7b59f1b8032a9512837b8d9e41379d0e6d8b8 :: needs real behavior proof before merge. :: [P1] Prevent conflict reload from authorizing the stale draft | [P1] Serialize the hash check with the agent-file write
  • reviewed 2026-09-06T02:55:37.678Z sha 82fdee3d9d857ef7b7ca38d7de633a3c4646b0bc :: blocked before merge. :: [P1] Preserve the dirty draft's base hash across Refresh
  • reviewed 2026-09-06T04:04:30.528Z sha 3c4f936 :: needs changes before merge. :: [P2] Update the draft hash when Reset adopts refreshed content
  • reviewed 2026-09-09T05:29:07.304Z sha 4303c93 :: needs maintainer review before merge. :: none

@yetval
yetval force-pushed the fix/agents-files-set-cas branch from 75e7b59 to 82fdee3 Compare September 6, 2026 02:48
@yetval

yetval commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Refreshed against current main. Both P1 findings from the 75e7b59f1b80 review are fixed in the diff, each with its own regression case and its own before/after trace in the body.

[P1] Serialize the hash check with the agent-file write. Fixed at the boundary you named. enqueueWorkspaceFileUpdate in src/gateway/server-methods/workspace-fs.ts is now exported and owns the agent-file compare-and-write, so agents.files.set shares the one queue that already serializes sessions.files.set instead of duplicating an unserialized copy. One agent workspace file is reachable from both routes, so a per-route queue would not have closed it. Concurrent-save coverage added in agents-files.test.ts; it fails on the reviewed head with expected [ { ok: true, ...(2) }, ...(1) ] to have a length of 1 but got 2. The body carries a real two-writer trace against the reviewed head and against this head.

[P1] Prevent conflict reload from authorizing the stale draft. Fixed. The forced reload that refreshed the base hash while keeping the draft is removed. A refused write keeps the hash it was refused against, so a repeated Save is refused again rather than winning. Resolution is now explicit: the conflict callout offers Reload (take the workspace version, drop the draft) and Overwrite (re-read the current hash, then deliberately replace the workspace version), the same two-button contract chat-detail-panel.ts already uses for session_file_conflict. Second-Save coverage added in ui/src/pages/agents/files.test.ts, plus reload and overwrite cases.

Real Control UI proof. Added. The body carries a trace from real headless Chromium driving the real Control UI bundle against a real Gateway on a loopback port and a real agent workspace on disk, run on pristine main 82a74b1 and on this head with identical inputs. On main the Save lands silently and the agent's appended line is erased; here the Save is refused, the callout names the file and offers Reload and Overwrite, and a second click leaves the workspace bytes untouched. ui/src/e2e/agent-file-lifecycle.real-gateway.e2e.test.ts now also carries the conflict, Overwrite and Reload flow so this stays covered.

The three merge-risk items map onto the two findings and the proof above.

One gap left open deliberately, stated in the body: a file that does not exist yet has no base token to send, so an operator Save that creates a bootstrap file can still race an agent creating the same file first. Closing that needs an expectedAbsent precondition on the protocol, which is a wider surface change than this fix and a maintainer call.

New head: 82fdee3d9d857ef7b7ca38d7de633a3c4646b0bc.

@yetval
yetval marked this pull request as ready for review September 6, 2026 02:49
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 6, 2026
…iles changed since they were read

The Control UI Agents Files editor saved whatever it held through
agents.files.set, which wrote unconditionally. When the agent had appended
memories to MEMORY.md (or any bootstrap file) after the operator opened it,
Save replaced the file with the stale draft and reported ok.

agents.files.get and agents.files.set now return the file's SHA-256 content
hash, the same token sessions.files.set already uses. agents.files.set accepts
an optional expectedHash and refuses the write with an agent_file_conflict
error carrying currentHash when the on-disk hash differs. The compare and the
write run inside the workspace update queue that already owns sessions.files.set,
so two concurrent saves holding the same base hash cannot both be admitted.
Omitting expectedHash keeps the unconditional overwrite for older clients.

The Control UI sends the hash it last read. A refused write keeps that hash, so
pressing Save again cannot win by accident; the conflict callout offers Reload
and Overwrite, the same explicit resolution the session file editor already
uses. Swift protocol models regenerated; the Kotlin output is unchanged.
@yetval
yetval force-pushed the fix/agents-files-set-cas branch from 82fdee3 to 3c4f936 Compare September 6, 2026 03:58
@yetval

yetval commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

The round-2 finding was correct and is fixed. New head: 3c4f936, rebased onto 4e33055.

[P1] Preserve the dirty draft's base hash across Refresh. The stored hash is now the draft's write precondition rather than the base's. It advances only when the draft advances with it: on a write, on an explicit Reload or Overwrite, or on a read that rebases a clean draft. loadAgentFiles(agentId, true) from the Core Files Refresh button still refreshes the displayed base and still spares a dirty draft, but that draft keeps the precondition it was actually typed against, so the following Save is refused. Refresh also no longer dismisses a standing conflict, and the callout carries its own copy so it survives the cleared error.

Coverage added in ui/src/pages/agents/files.test.ts: dirty Refresh then Save, clean Refresh adopting the new hash, and conflict survival through Refresh. The first and third fail on 82fdee3d9d85 for their own reasons (draft carrying bbbb... instead of aaaa..., and expected null to be 'AGENTS.md'); the clean-Refresh case passes on both heads, so the existing rebase-a-clean-draft contract is unchanged. ui/src/e2e/agent-file-lifecycle.real-gateway.e2e.test.ts now also drives Refresh-then-Save.

Live reproduction of the finding, and of the fix. The same browser driver ran unchanged against three trees. On 82fdee3d9d85 the two Saves were refused as intended, then Refresh-then-Save wrote "# Persona\n- operator note\n", discarding both the agent's memory and the line appended after it. On this head the same clicks leave "# Persona\n- agent learned the operator's birthday\n- a later memory\n" on disk with the draft still in the editor. On pristine main the very first Save clobbers with no callout. All three traces are in the body.

One note on gates: the whole-graph oxlint:core shard exhausts this machine's memory, so I ran the same type-aware lane scoped to every changed file with --tsconfig config/tsconfig/oxlint.core.json instead, clean. tsgo:core, tsgo:ui, tsgo:core:test, ui:i18n:verify and both protocol guards are clean, and CI will run the full shard.

Still open and deliberate, unchanged from the last round: a file that does not exist yet has no base token, so an operator Save that creates a bootstrap file can still race an agent creating the same file first. Closing that needs an expectedAbsent protocol precondition, which is a maintainer call rather than something to fold in here.

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Sep 6, 2026
@obviyus obviyus self-assigned this Sep 9, 2026
Merge the pinned main integration while retaining the conditional-save contributor change. Pair refreshed text and hash on Reset, fence Overwrite after its read, and normalize schema-valid hash case at the agent write boundary.
@obviyus obviyus changed the title fix(gateway): saving an agent workspace file from the Control UI overwrites content changed since it was opened fix(gateway): preserve concurrent agent workspace file edits Sep 9, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: L triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 9, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed 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. labels Sep 9, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Sep 9, 2026
@obviyus

obviyus commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 135865
head: c62a116
run: 34315564760 attempt: 1
failed: checks-node-compact-large-19 job=102351454927 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit 42db921 into openclaw:main Sep 9, 2026
219 of 221 checks passed
@obviyus

obviyus commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks @yetval! Merged in 42db921.

Bug: Save could silently replace workspace changes made after the editor opened a file.

Fix: Conditional writes share the existing workspace queue. Repeated Save and dirty Refresh retain the draft's original hash. Reload, Overwrite, and Reset adopt the appropriate matching text/hash; Overwrite also checks that its editor scope remains active.

Proof: Real Gateway, served Control UI, Chromium, independent disk reads, and source-blind acceptance covered conflict refusal and recovery. Concurrent agent/agent and agent/session writes produced one success. All 139 focused tests passed, including the corrected preview fixture's five Chromium cases. Fresh review passed on c62a1162.

Before After
A 46-byte stale draft replaced a later 62-byte file Save reports conflict and preserves the 62-byte file
Reset could adopt refreshed text with an old hash Reset adopts the matching hash; the next edit saves

Unrelated CI exception: Run 34315564760, attempt 1, finished with one failed child: checks-node-compact-large-19. code-mode-headless.test.ts:883 expected timeout but received internal_error; the aggregate gate failed consequently. Landing used the PR-specific standing approval through the guarded merge path.

A controlled reproduction on main 3f0f98ef demonstrated the existing deadline error-code race: mixed fake timers and real performance.now() scheduled the inner deadline at 14,805 ms before the 15,000 ms root abort, producing internal_error with the headless-timeout message. Aligning the clocks returned timeout. The original timeout assertion was retained and failed in the red case. The relevant owner, test, timer, and dependency sources match this PR's tested main parent and merge.

The fake tool invocation does not call the file editor or workspace queue, and this PR changes no Code Mode deadline or worker state. The reproduced inline-worker classification path was added in #141265, ce8fb532; its parent diff and ancestry were checked. That commit names RoboClaw as author, GitHub as committer, and credits @Takhoffman. This is a separate owner-level follow-up, not a change folded into this PR.

No identical hosted main run, complete 96-file replay, or original hosted error message is claimed. Missing-file creation races and writers outside the process-local queue remain the documented limits. The distinct Refresh-cache issue #127592 remains untouched.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…w#135865)

Refuse stale agent-file saves through the existing workspace update queue and offer explicit Reload and Overwrite recovery. Preserve draft ancestry across Refresh, adopt matching text and hash on Reset, and fence the Overwrite continuation against retired editor scope.

Verified with real Gateway and Chromium red/green proof, independent browser acceptance, concurrent agent/session writer controls, and focused regression coverage. Retains the contributor's conditional-save repair and current file admission, identity, size, and session behavior.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants