Skip to content

model.generationConfig won't work when update credentials using /auth -> openai #1506

@Mingholy

Description

@Mingholy

What happened?

  1. Because the modelProviders takes precedence over model in settings.json, after updating credentials using /auth -> openai, the manual input credentials take effect but the model.generationConfig doesn't.
  2. If security.auth.selectedType and model.name can not hit a provider's model, qwen-code will always auto select the first available provider's model, ignoring the settings.
  3. With a proper API key AND without a model set in env variables, say only GEMINI_API_KEY but no GEMINI_MODEL, qwen-code still infers the authType as gemini and complains about no GEMINI_MODEL, this should be improved.

What did you expect to happen?

  1. Merge model.generationConfig when update credentials manually.
  2. Refine the fallback strategy, do not enforce to use models in providers.
  3. Auto select inferred authType should only be happening when all required env variables present.

What's next?

#1510 mainly addressed authType/model fallback issues and ensures model.generationConfig being effective when selecting a non-provider model.
The root cause of the unexpected behaviours above is that we treated model.apiKey,model.baseUrl,model.name as programmatic override via '/auth' AND at the same time some kind of conditionally 'fallback' that may take precedence at startup.
This ambiguity and confusion has led to some parsing problems.
One feasible solution is to parse out the non-provider model configurations in settings and environment together, and use them as /model options to provide a stable and consistent model switching function.

Client information

Client Information CLI Version 0.7.0

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

Labels

status/needs-triageIssue needs to be triaged and labeledtype/bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions