mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Sync upstream Gemini-CLI v0.8.2 (#838)
This commit is contained in:
@@ -16,7 +16,6 @@ import type {
|
||||
ToolConfirmationOutcome,
|
||||
ToolCallConfirmationDetails,
|
||||
} from '../tools/tools.js';
|
||||
import { createContentGenerator } from '../core/contentGenerator.js';
|
||||
import { getEnvironmentContext } from '../utils/environmentContext.js';
|
||||
import type {
|
||||
Content,
|
||||
@@ -55,6 +54,7 @@ import type { SubagentHooks } from './subagent-hooks.js';
|
||||
import { logSubagentExecution } from '../telemetry/loggers.js';
|
||||
import { SubagentExecutionEvent } from '../telemetry/types.js';
|
||||
import { TaskTool } from '../tools/task.js';
|
||||
import { DEFAULT_QWEN_MODEL } from '../config/models.js';
|
||||
|
||||
/**
|
||||
* @fileoverview Defines the configuration interfaces for a subagent.
|
||||
@@ -329,7 +329,10 @@ export class SubAgentScope {
|
||||
this.eventEmitter?.emit(SubAgentEventType.START, {
|
||||
subagentId: this.subagentId,
|
||||
name: this.name,
|
||||
model: this.modelConfig.model,
|
||||
model:
|
||||
this.modelConfig.model ||
|
||||
this.runtimeContext.getModel() ||
|
||||
DEFAULT_QWEN_MODEL,
|
||||
tools: (this.toolConfig?.tools || ['*']).map((t) =>
|
||||
typeof t === 'string' ? t : t.name,
|
||||
),
|
||||
@@ -367,6 +370,9 @@ export class SubAgentScope {
|
||||
};
|
||||
|
||||
const responseStream = await chat.sendMessageStream(
|
||||
this.modelConfig.model ||
|
||||
this.runtimeContext.getModel() ||
|
||||
DEFAULT_QWEN_MODEL,
|
||||
messageParams,
|
||||
promptId,
|
||||
);
|
||||
@@ -828,26 +834,15 @@ export class SubAgentScope {
|
||||
generationConfig.systemInstruction = systemInstruction;
|
||||
}
|
||||
|
||||
const contentGenerator = await createContentGenerator(
|
||||
this.runtimeContext.getContentGeneratorConfig(),
|
||||
this.runtimeContext,
|
||||
this.runtimeContext.getSessionId(),
|
||||
);
|
||||
|
||||
if (this.modelConfig.model) {
|
||||
await this.runtimeContext.setModel(this.modelConfig.model);
|
||||
}
|
||||
|
||||
return new GeminiChat(
|
||||
this.runtimeContext,
|
||||
contentGenerator,
|
||||
generationConfig,
|
||||
start_history,
|
||||
);
|
||||
} catch (error) {
|
||||
await reportError(
|
||||
error,
|
||||
'Error initializing Gemini chat session.',
|
||||
'Error initializing chat session.',
|
||||
start_history,
|
||||
'startChat',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user