feat: subagent phase 2 implementation

This commit is contained in:
tanzhenxin
2025-09-03 19:17:29 +08:00
parent c49e4f6e8a
commit 5d8874205d
33 changed files with 2435 additions and 21 deletions

View File

@@ -8,7 +8,8 @@ import { createHash } from 'crypto';
import { GeminiEventType, ServerGeminiStreamEvent } from '../core/turn.js';
import { logLoopDetected } from '../telemetry/loggers.js';
import { LoopDetectedEvent, LoopType } from '../telemetry/types.js';
import { Config, DEFAULT_GEMINI_FLASH_MODEL } from '../config/config.js';
import { Config } from '../config/config.js';
import { DEFAULT_QWEN_FLASH_MODEL } from '../config/models.js';
const TOOL_CALL_LOOP_THRESHOLD = 5;
const CONTENT_LOOP_THRESHOLD = 10;
@@ -360,7 +361,7 @@ Please analyze the conversation history to determine the possibility that the co
try {
result = await this.config
.getGeminiClient()
.generateJson(contents, schema, signal, DEFAULT_GEMINI_FLASH_MODEL);
.generateJson(contents, schema, signal, DEFAULT_QWEN_FLASH_MODEL);
} catch (e) {
// Do nothing, treat it as a non-loop.
this.config.getDebugMode() ? console.error(e) : console.debug(e);