fix(kiloclaw): preserve user-edited IDENTITY.md across redeploys#2389
Open
kvnkho wants to merge 2 commits intoKilo-Org:mainfrom
Open
fix(kiloclaw): preserve user-edited IDENTITY.md across redeploys#2389kvnkho wants to merge 2 commits intoKilo-Org:mainfrom
kvnkho wants to merge 2 commits intoKilo-Org:mainfrom
Conversation
writeBotIdentityFile runs on every controller boot (via runOnboardOrDoctor), and previously always overwrote /root/.openclaw/workspace/IDENTITY.md with content regenerated from KILOCLAW_BOT_* env vars. Any edits a user made to IDENTITY.md were lost on the next redeploy. Mirror the TOOLS.md behavior: seed on first boot, but skip the write if the file already exists. Legacy file cleanup still runs unconditionally. Fixes Kilo-Org#2387
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 #2387.
writeBotIdentityFileruns on every controller boot (viarunOnboardOrDoctor), and previously always overwrote/root/.openclaw/workspace/IDENTITY.mdwith content regenerated fromKILOCLAW_BOT_*env vars. Any edits a user made toIDENTITY.mdwere lost on the next redeploy.This PR mirrors the
TOOLS.mdbehavior: seed on first boot, but skip the write when the file already exists. Legacy-identity-file cleanup still runs unconditionally.Verification
pnpm exec vitest run controller/src/bootstrap.test.tsinservices/kiloclaw— 63 passed (including a new test assertingIDENTITY.mdis not rewritten when it already exists).pnpm run typecheckinservices/kiloclaw— clean.scripts/lint-all.sh— clean.pnpm format:check— clean.Visual Changes
N/A
Reviewer Notes
Considered an alternative (guarding the call site inside
runOnboardOrDoctorto only run on fresh installs), but guarding insidewriteBotIdentityFileitself keeps the seeding path working even if a config already exists for other reasons, and keeps the rule in one place. Open to flipping if reviewers prefer the other shape.