fix(workspace): detect user content to prevent re-bootstrapping after config loss#27492
Closed
widingmarcus-cyber wants to merge 1 commit intoopenclaw:mainfrom
Closed
Conversation
Contributor
Greptile SummaryPrevents
Confidence Score: 5/5
Last reviewed commit: f9096a0 |
… config loss (openclaw#27314) When config is lost/corrupted and 'openclaw configure' re-runs, the workspace seeder could treat an existing workspace as brand new if template files were missing, triggering BOOTSTRAP.md creation and potentially confusing the user. Changes: - ensureAgentWorkspace: isBrandNewWorkspace now checks for memory/ dir and MEMORY.md in addition to template files. A workspace with user content is never treated as brand new. - Legacy migration path: also checks for memory/ and MEMORY.md as indicators of completed onboarding, preventing BOOTSTRAP seeding when template files match defaults but user data exists. - Configure wizard: shows 'Existing workspace' note when user content is detected but no config exists, reassuring users their files are preserved. - New test: workspace with memory/ but no template files is treated as existing, not brand new. Closes openclaw#27314
f9096a0 to
1d1cc23
Compare
Contributor
Author
|
Closing — upstream has diverged significantly in the affected files (workspace.ts, configure.wizard.ts). Will re-evaluate if the issue resurfaces. |
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.
Summary
Fixes #27314 —
openclaw configurecould silently re-bootstrap an existing workspace after config corruption, leading to data loss.Root Cause
When config is lost/corrupted (e.g., during restart cycles), running
openclaw configurecreates a fresh config. The workspace seeder'sisBrandNewWorkspacecheck only looked at template files (SOUL.md, IDENTITY.md, etc.). If those were somehow missing, the workspace was treated as brand new, triggering BOOTSTRAP.md seeding even when user data (memory/, MEMORY.md) existed.Changes
src/agents/workspace.tsisBrandNewWorkspace: Now also checks formemory/dir andMEMORY.mdas user-content indicators. A workspace with user content is never treated as brand new.src/commands/configure.wizard.tssrc/agents/workspace.test.tsmemory/dir andMEMORY.mdbut no template files is treated as existing, not brand new.Test Results
All 14 workspace tests pass including the new regression test.
@greptile-apps please review