fix: preserve custom lead agent names during reprovisioning#283
Open
aramirez087 wants to merge 5 commits intoabhi1693:masterfrom
Open
fix: preserve custom lead agent names during reprovisioning#283aramirez087 wants to merge 5 commits intoabhi1693:masterfrom
aramirez087 wants to merge 5 commits intoabhi1693:masterfrom
Conversation
`ensure_board_lead_agent()` unconditionally reset the agent name to "Lead Agent" on every lifecycle reconciliation because `config_options .agent_name` is None during automated reprovisions, falling through to the static default. This meant any custom name set via PATCH (e.g. "Ferris", "Sentinel") was silently overwritten on the next gateway restart or heartbeat config patch — sometimes within minutes. Fix: prefer the agent's existing name over the static default. The fallback chain is now: explicit config name → existing DB name → "Lead Agent" (only for brand-new agents with no name). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a provisioning reconciliation bug in the OpenClaw DB provisioning service where board lead agent display names set via PATCH were being overwritten back to the static default during reprovisioning.
Changes:
- Updates
ensure_board_lead_agent()to prefer the existing persisted lead agentnamewhen no explicitagent_nameoverride is provided. - Keeps the static default lead agent name as the fallback for newly created lead agents.
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
ensure_board_lead_agent()always fell back to the static default name whenconfig_options.agent_namewasNone(which it is during automated reprovisions)The bug
Every gateway restart, heartbeat config patch, or lifecycle reconciliation would overwrite custom names. In practice this meant renamed agents reverted within minutes.
The fix
Fallback chain: explicit config name > existing DB name > "Lead Agent" (new agents only).
Test plan
make backend-test— 469 passed, 0 failed🤖 Generated with Claude Code