Skip to content

fix(onboard): preserve named-agent profiles during config resets - #127716

Merged
steipete merged 1 commit into
mainfrom
codex/onboarding-reset-named-agent-auth-owner
Aug 22, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/onboarding-reset-named-agent-auth-owner

Conversation

@steipete

@steipete steipete commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users resetting only their OpenClaw configuration could not reuse an existing provider profile for a named first agent. For example, openclaw onboard --reset --reset-scope config --agent-name robby --auth-choice apiKey --token-provider anthropic incorrectly rejected setup as missing a profile even though the preserved robby agent already owned one.

Why This Change Was Made

Reset preflight correctly validates against the future empty configuration, but it previously resolved provider profiles without the future agent identity or selected workspace, implicitly looking under main. Resolve the pending post-reset target through the existing canonical onboarding owner and carry its agent directory and workspace into both plugin-provider and custom-provider validation. Configuration-only resets may reuse preserved profiles; reset scopes that delete credentials continue to fail before changing state.

User Impact

Operators can reconfigure an existing named agent without reentering a provider key when requesting a configuration-only reset. Named-agent normalization, inherited main profiles, default-agent setup, selected workspaces, and destructive-reset safety retain their existing behavior.

Evidence

The exact unmodified production owner reproduced both failures before the fix: plugin and custom validation each received no agent directory and no selected workspace. An actual installed models auth --agent robby command created a real isolated named-only SQLite provider profile; both actual onboard and setup then exited 1 before reset despite that preserved profile. Replaying the repaired exact current validation in the same installed commands accepts the named profile and proceeds through reset. The available older installed executable cannot finish the unrelated later agent-creation phase because its obsolete roster lifecycle predates named-first-agent support; the current complete production owner independently passes all ten named/default/custom/workspace/reset-scope checks. A five-row owner-boundary regression covers robby, normalized Robby!, default main, configuration-only profile reuse, and both credential-destructive reset scopes; the test file is one line smaller after consolidating duplicate existing cases. Existing inherited-main CLI behavior remains compatible. Changed-file formatting, scoped lint, offline TruffleHog scanning, independent architecture review, and independent Codex autoreview all pass. Production delta: +17/-2; tests: +73/-74.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels Aug 22, 2026
@steipete
steipete merged commit 0a70481 into main Aug 22, 2026
176 checks passed
@steipete
steipete deleted the codex/onboarding-reset-named-agent-auth-owner branch August 22, 2026 00:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant