Repository navigation
fix(onboard): rebase non-interactive commit onto first-agent write - #113601
Merged
Merged
Conversation
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 26, 2026
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
openclaw onboard --non-interactive(any auth choice) fails on a fresh install withConfigMutationConflictError: config changed since last loadand leaves a HALF-WRITTEN config — only the agent roster entry, no model, no provider, no gateway. Found by live testing on current main; reproduced deterministically on fresh state dirs.Why This Change Was Made
#112678 (roster-only refactor) made onboarding create the first roster agent through
createAgent, which WRITES the config file mid-flow.runNonInteractiveSetupcapturessnapshot.hashbefore that and passes it as the optimistic-concurrency baseline to the final commit, so the guard rejects onboarding's own write.ensureOnboardingAgentnow reports the post-create config hash (only on the path where it actually created the agent), and non-interactive local setup adopts it as the effective baseline. Foreign-write protection is preserved: the baseline is only advanced past a write we made ourselves; every other path keeps the original hash and the original guard semantics.User Impact
Fresh non-interactive onboarding completes again and writes a full config; no more half-configured installs from a failed first run. Regression window is #112678 (2026-07-24) to now.
Evidence
Live reproduction on current main (fresh
OPENCLAW_STATE_DIR,--auth-choice ollama): before =ConfigMutationConflictError+ partial config containing onlyagents.entries.main; after = "Updated config" and a complete config (modelollama/gemma4:latest, providerollama, rostermain, gateway port).Bisected to #112678 by running the same command on its parent (
5f63f744ead— succeeds) vs the commit itself (fails). Config-write tracing pinned the intermediate writer to agent-create'stransformConfigFileWithRetry.Tests:
node scripts/run-vitest.mjs src/commands/onboard-agent.test.ts src/commands/onboard-non-interactive— 9 files / 57 passed, including two new regression tests (post-create hash reported; hash omitted when nothing was created);node scripts/run-vitest.mjs src/config/mutate— 46 passed. Autoreview clean (0.94).Follow-up, intentionally not fixed here:
src/commands/setup.tscallsensureOnboardingAgentand then writes with the pre-createsnapshot; it does not pass abaseHash, so it does not throw, but the stale snapshot is a latent hazard.Related: #112678.