fix(delegate): respect chat.defaultAgent setting when no agent is specified#3720
Open
sandikodev wants to merge 1 commit intoaws:mainfrom
Open
fix(delegate): respect chat.defaultAgent setting when no agent is specified#3720sandikodev wants to merge 1 commit intoaws:mainfrom
sandikodev wants to merge 1 commit intoaws:mainfrom
Conversation
…cified
When the delegate tool is invoked without an explicit agent name, it
was unconditionally falling back to the hardcoded DEFAULT_AGENT_NAME
("q_cli_default"), ignoring the user's chat.defaultAgent setting.
Fix the fallback chain to:
1. Use the explicitly provided agent name (unchanged)
2. Fall back to chat.defaultAgent setting if set
3. Fall back to DEFAULT_AGENT_NAME as last resort
Fixes aws#3174
d01266a to
f0e3706
Compare
Author
|
Update (amended commit): Tests were added after initial submission to verify the fallback chain logic:
The resolution logic was extracted into a local |
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.
Issue
Closes #3174
Problem
When the
delegatetool is invoked without an explicitagentparameter, it unconditionally falls back to the hardcodedDEFAULT_AGENT_NAME("q_cli_default"), ignoring the user'schat.defaultAgentsetting.Reproduction:
Fix
Change the fallback chain from:
To:
New fallback chain:
agentparameter (unchanged)chat.defaultAgentsetting (if configured)DEFAULT_AGENT_NAMEas last resortTesting
Four tests cover the full fallback chain:
explicit_agent_takes_priority— explicit parameter overrides everythingconfigured_default_used_when_no_explicit_agent—chat.defaultAgentis used when no explicit agent is givenfalls_back_to_default_agent_name_when_nothing_configured—DEFAULT_AGENT_NAMEis used as last resortget_schema— existing schema test (unchanged)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.