feat: update code

This commit is contained in:
pomelo-nwu
2025-11-05 11:23:27 +08:00
parent 6357a5c87e
commit 2967bec11c
7 changed files with 102 additions and 83 deletions

View File

@@ -1166,12 +1166,10 @@ export class Config {
registerCoreTool(TodoWriteTool, this);
registerCoreTool(ExitPlanModeTool, this);
registerCoreTool(WebFetchTool, this);
// Conditionally register web search tool if any web search provider is configured
// or if using qwen-oauth authentication
if (
this.getWebSearchConfig() ||
this.getAuthType() === AuthType.QWEN_OAUTH
) {
// Conditionally register web search tool if web search provider is configured
// buildWebSearchConfig ensures qwen-oauth users get dashscope provider, so
// if tool is registered, config must exist
if (this.getWebSearchConfig()) {
registerCoreTool(WebSearchTool, this);
}