fix(ui): enable save button when editing default agent models#20968
Open
Gitjay11 wants to merge 2 commits intoopenclaw:mainfrom
Open
fix(ui): enable save button when editing default agent models#20968Gitjay11 wants to merge 2 commits intoopenclaw:mainfrom
Gitjay11 wants to merge 2 commits intoopenclaw:mainfrom
Conversation
1 task
|
This pull request has been automatically marked as stale due to inactivity. |
Author
I am waiting for maintainers to review it |
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
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Users can now edit the Primary model and Fallbacks for the default agent in the /agents sidebar and successfully save those changes to their configuration.
Security Impact (required)
No)No)No)No)No)Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Verified via code audit that the update correctly targets agents.defaults.model as an object { primary: modelId } to satisfy AgentDefaultsSchema (found in src/config/zod-schema.agent-defaults.ts).
Human Verification (required)
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
Risks and Mitigations
Greptile Summary
Fixed Save button in
/agentsUI for default agent model changes. Previously, editing the primary model or fallbacks for the default agent (when not explicitly listed inagents.list) would return early without marking the configuration as dirty, leaving the Save button disabled. The handlers now check if the agent matchesstate.agentsList?.defaultIdand correctly targetagents.defaults.modelwith proper object wrapping ({ primary: modelId }) to comply with the AgentDefaults Zod schema.onModelChangeandonModelFallbacksChangehandlers now support default agent editing{ primary, fallbacks? }object when updating defaultsagents.listConfidence Score: 4/5
agents.defaults.modelwhen the agent isn't in the list. The object wrapping logic properly aligns with the strict Zod schema requirements. However, there's a minor edge case: the code assumesstate.agentsList?.defaultIdexists when falling through to the default path - ifdefaultIdis undefined, the code would still return early, which is correct. The fix is well-structured and maintains backward compatibility.Last reviewed commit: 1488ddf