Repository navigation
fix: worktree session files fail to open with "Session workspace changed during file read" - #172579
Merged
Merged
Conversation
… source sessions.files list/get for managed-worktree sessions re-reads the session entry during settlement to detect a reset or worktree change. Since #169757 that re-read passed the logical store path to readRetainedSessionEntryFacts, which only knows the physical SQLite path, so it always returned undefined and every request failed with "Session workspace changed during file read". Use the captured read source path, matching the other retained-facts callers. Co-authored-by: Patrick-Erichsen <[email protected]>
roboclaw-bot
marked this pull request as ready for review
October 14, 2026 21:59
Contributor
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
Collaborator
Author
|
Merged via squash auto-merge.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 15, 2026
… source (openclaw#172579) sessions.files list/get for managed-worktree sessions re-reads the session entry during settlement to detect a reset or worktree change. Since openclaw#169757 that re-read passed the logical store path to readRetainedSessionEntryFacts, which only knows the physical SQLite path, so it always returned undefined and every request failed with "Session workspace changed during file read". Use the captured read source path, matching the other retained-facts callers. Co-authored-by: Patrick-Erichsen <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes: files in a project worktree session fail to open in the side panel or Files panel with
Session workspace changed during file read, even when nothing about the session has changed.User Impact
User impact: HTML previews and other files from worktree-backed sessions open again in the Control UI. Sessions without a worktree were not affected.
Why This Change Was Made
sessions.files.listandsessions.files.getre-read the session after waiting for sandbox settlement, to refuse the read if the session was reset or moved to a different worktree in the meantime. Since #169757, that re-read used the logical session store path, which the retained-facts reader does not recognize, so it always came back empty and every worktree read was refused. The re-read now uses the session's captured read source, the same way the other retained-facts callers do. The safety check itself is unchanged.Evidence
Real Gateway (isolated test instance), real project worktree session created with
sessions.create, Control UI in Chromium, clicking an assistant link tohalloween-theme/preview.html:Before (current
maincode):After (this PR):
src/gateway/server-methods/sessions-files.worktree.test.ts(real SQLite session storage and Gateway handlers):mainwithSession workspace changed during file read, passes with this change.sessions-filessuites: 6 files, 89 tests passed.pnpm tsgo:coreand the gateway test typecheck shards passed;oxfmt --checkclean.The browser proof used a temporary real-Gateway Control UI spec that is not part of this PR; the Gateway-level test above is the regression coverage.
Reported by @Patrick-Erichsen.
Work sessions