mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 20:20:57 +00:00
fix: add model resolution warnings to start warnings
This commit is contained in:
parent
740f4e0949
commit
42a5b4d1e0
8 changed files with 29 additions and 13 deletions
|
|
@ -506,7 +506,7 @@ describe('modelConfigUtils', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should log warnings from resolveModelConfig', () => {
|
||||
it('should return warnings from resolveModelConfig', () => {
|
||||
const argv = {};
|
||||
const settings = makeMockSettings();
|
||||
const selectedAuthType = AuthType.USE_OPENAI;
|
||||
|
|
@ -521,14 +521,13 @@ describe('modelConfigUtils', () => {
|
|||
warnings: ['Warning 1', 'Warning 2'],
|
||||
});
|
||||
|
||||
resolveCliGenerationConfig({
|
||||
const result = resolveCliGenerationConfig({
|
||||
argv,
|
||||
settings,
|
||||
selectedAuthType,
|
||||
});
|
||||
|
||||
expect(mockWriteStderrLine).toHaveBeenCalledWith('Warning 1');
|
||||
expect(mockWriteStderrLine).toHaveBeenCalledWith('Warning 2');
|
||||
expect(result.warnings).toEqual(['Warning 1', 'Warning 2']);
|
||||
});
|
||||
|
||||
it('should use custom env when provided', () => {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import {
|
|||
type ProviderModelConfig,
|
||||
} from '@qwen-code/qwen-code-core';
|
||||
import type { Settings } from '../config/settings.js';
|
||||
import { writeStderrLine } from './stdioHelpers.js';
|
||||
|
||||
export interface CliGenerationConfigInputs {
|
||||
argv: {
|
||||
|
|
@ -42,6 +41,8 @@ export interface ResolvedCliGenerationConfig {
|
|||
generationConfig: Partial<ContentGeneratorConfig>;
|
||||
/** Source attribution for each resolved field */
|
||||
sources: ContentGeneratorConfigSources;
|
||||
/** Warnings generated during resolution */
|
||||
warnings: string[];
|
||||
}
|
||||
|
||||
export function getAuthTypeFromEnv(): AuthType | undefined {
|
||||
|
|
@ -130,11 +131,6 @@ export function resolveCliGenerationConfig(
|
|||
|
||||
const resolved = resolveModelConfig(configSources);
|
||||
|
||||
// Log warnings if any
|
||||
for (const warning of resolved.warnings) {
|
||||
writeStderrLine(warning);
|
||||
}
|
||||
|
||||
// Resolve OpenAI logging config (CLI-specific, not part of core resolver)
|
||||
const enableOpenAILogging =
|
||||
(typeof argv.openaiLogging === 'undefined'
|
||||
|
|
@ -158,5 +154,6 @@ export function resolveCliGenerationConfig(
|
|||
baseUrl: resolved.config.baseUrl || '',
|
||||
generationConfig,
|
||||
sources: resolved.sources,
|
||||
warnings: resolved.warnings,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue