fix(gateway): use default agent model for session defaults#1038
Open
BingqingLyu wants to merge 3 commits into
Open
fix(gateway): use default agent model for session defaults#1038BingqingLyu wants to merge 3 commits into
BingqingLyu wants to merge 3 commits into
Conversation
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
Fixes openclaw#50156.
sessions.list.defaultswas resolving the fallback model from the global hardcoded default path, which ignored the default agent's effectivemodel.primary. In Control UI this surfaced as a misleading extra "Default (...)" choice when a single configured agent had its own primary model.This changes
getSessionDefaults()to resolve throughresolveDefaultModelForAgent()using the repo's default agent id, so the gateway reports the same primary model the default agent will actually run.Changes
src/gateway/session-utils.ts: resolve session defaults from the default agent's effective model instead of the hardcoded global fallback path.src/gateway/session-utils.test.ts: add a regression test covering a default agent withmodel.primary = minimax/MiniMax-M2.5and no globalagents.defaults.model.primary.Test plan
pnpm exec oxfmt --check src/gateway/session-utils.ts src/gateway/session-utils.test.tspnpm test -- src/gateway/session-utils.test.ts -t "getSessionDefaults prefers the default agent primary model over the hardcoded fallback"node_modules/@mariozechner/pi-aiis still linked to0.54.1, so the suite fails during import on@mariozechner/pi-ai/oauthbefore the test runs.AI-assisted
This PR was authored with AI assistance. I reviewed the change and verified the root cause in code before submitting.