Commit graph

15 commits

Author SHA1 Message Date
顾盼
aeeb2976d6
feat(web-search): remove built-in web_search tool, replace with MCP-based approach (#3502)
* feat(web-search): add GLM (ZhipuAI) web search provider

- Add GlmProvider class implementing BaseWebSearchProvider using the
  ZhipuAI Web Search API (https://open.bigmodel.cn/api/paas/v4/web_search)
- Support multiple search engines: search_std, search_pro, search_pro_sogou,
  search_pro_quark
- Support optional config: maxResults, searchIntent, searchRecencyFilter,
  contentSize, searchDomainFilter
- Truncate query to 70 characters per API limit
- Register 'glm' in the provider discriminated union (types.ts) and
  createProvider() switch (index.ts)
- Add GlmProviderConfig to settingsSchema, ConfigParams, and Config class
- Add --glm-api-key CLI flag and GLM_API_KEY env var support in webSearch.ts
- Forward GLM_API_KEY in sandbox environment
- Update provider priority list: Tavily > Google > GLM > DashScope
- Add 17 unit tests for GlmProvider and 4 integration tests in index.test.ts
- Update docs/developers/tools/web-search.md with GLM configuration,
  env vars, CLI args, pricing, and corrected DashScope billing info
- Fix stale OAuth/free-tier references in web-search.md

Closes #3496

* docs(web-search): fix DashScope note and add GLM server-side limitations

* fix(web-search): make DashScope provider work with standard API key, remove qwen-oauth dependency

- DashScopeProvider.isAvailable() now checks config.apiKey instead of authType
- Remove OAuth credential file reading and resource_url requirement
- Use standard DashScope endpoint: dashscope.aliyuncs.com/api/v1/indices/plugin/web_search
- Read DASHSCOPE_API_KEY env var and --dashscope-api-key CLI flag
- Forward DASHSCOPE_API_KEY into sandbox environment
- Update integration test to detect DASHSCOPE_API_KEY
- Update docs to reflect new API key based configuration

* feat(web-search): remove built-in web search tool

The web_search tool and all related provider implementations are removed.
Web search functionality will be provided via MCP integrations instead,
which is the direction the broader agent ecosystem is moving.

Removed:
- packages/core/src/tools/web-search/ (entire directory)
- packages/cli/src/config/webSearch.ts
- integration-tests/cli/web_search.test.ts
- ToolNames.WEB_SEARCH, ToolErrorCode.WEB_SEARCH_FAILED
- webSearch config in ConfigParams, Config class, settingsSchema
- CLI options: --tavily-api-key, --google-api-key, --google-search-engine-id,
  --glm-api-key, --dashscope-api-key, --web-search-default
- Sandbox env forwarding for TAVILY/GLM/DASHSCOPE/GOOGLE search keys
- web_search from rule-parser, permission-manager, speculation gate,
  microcompact tool set, and builtin-agents tool list

* fix: remove websearch reference

* docs: remove websearch tool

* docs: add break change guide

* fix review
2026-04-24 11:29:02 +08:00
tanzhenxin
9824e395a8 refactor(core): rename read_file parameter from absolute_path to file_path
This unifies the parameter naming convention across file-related tools
(edit, write_file, read_file) to consistently use file_path.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-20 11:05:47 +08:00
mingholy.lmh
f1c88e9bc9 style: apply formatting and linting fixes across codebase
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-06 21:58:22 +08:00
pomelo-nwu
b2b30c4c5d feat(runner): support auth_type for model configuration
- Add ModelSpec dataclass to hold model name and optional auth_type
- Update RunConfig.models to use List[ModelSpec]
- Add auth_type field to RunRecord with serialization support
- Parse models from config as string or {name, auth_type} dict
- Pass --auth-type flag to qwen command when specified

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-19 11:55:42 +08:00
yiliang114
9830c70061 feat(vscode-ide-companion): 支持使用 server-side timestamp 进行消息排序
- 在 SessionUpdateMeta 中添加 timestamp 字段
- 为 UserMessageChunkUpdate 和 ToolCallUpdate 添加 _meta 字段
- 在 QwenAgentManager 中使用 server timestamp 而非客户端时间
- 在 QwenSessionUpdateHandler 中解析并传递 tool call timestamp
- 在 useToolCalls 中改进 timestamp 解析逻辑
- 修正 App.tsx 中 timestamp 处理,使用 nullish-coalescing operator
- 为 ToolCallUpdateData 和 ToolCallUpdate 类型添加 timestamp 和 _meta

feat(integration-tests): add file location extraction for tool calls

feat(webui): enhance ReadToolCall component with content preview and expand/collapse

refactor(webui): simplify SaveMemoryToolCall component UI

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-01 00:22:29 +08:00
pomelo-nwu
2259943f85 feat: update export html 2026-01-29 13:27:18 +08:00
pomelo-nwu
021680cd70 feat: add html template 2026-01-28 19:56:20 +08:00
tanzhenxin
acf5824a65 fix: resolve worktree paths and load keep_worktree from config
- Resolve worktree_dir to absolute path before using as cwd and QWEN_CODE_ROOT
- Load keep_worktree option from JSON config in load_config()

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-01-28 17:25:29 +08:00
tanzhenxin
3f16948225 feat: remove npm install/build and add keep_worktree option
- Remove npm install and npm run build from worktree initialization
- Remove INITIALIZING status enum and related code
- Add keep_worktree config option (default: false)
- When keep_worktree is true, worktree is preserved for debugging
- Renumber execution steps after removing initialize step

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-01-28 16:43:50 +08:00
tanzhenxin
0c1848896a Revert: use text output format instead of JSON
- Remove --output-format json from CLI commands
- Change output filenames from output-{N}.json back to stdout-{N}.txt
- Keep outputs in outputs/ subdirectory for clean structure

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-01-28 15:47:14 +08:00
tanzhenxin
09d4627a3d feat: move output files to outputs/ subdirectory for cleaner structure
- Move output-{N}.json and stderr-{N}.txt to outputs/ subdirectory
- Fix typo in toy-config.json results_file path (rest-run -> test-run)
- Add --output-format json to CLI commands
- Update file extensions from .txt to .json for stdout captures

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-01-28 15:29:11 +08:00
tanzhenxin
f48eec9a02 feat: add git diff capture and session log collection to concurrent runner
- Add git diff capture after each run, saved as diff.patch
- Add session log collection from ~/.qwen/projects/{id}/chats/
- Store session logs in outputs/{run_id}/chats/ with original filename
- Add session_id field to track chat recording UUID
- Modify cwd in session logs to actual runner working directory
- Remove stdout_file/stderr_file from top-level, keep only in prompt_results
- Rename logs folder to openai-logs
- Add File Writer task example for testing file creation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-01-28 14:57:15 +08:00
tanzhenxin
66259aca29 feat: add git branch support for worktree creation
Add optional branch configuration to specify which git branch to use
for worktree creation.

Features:
- New branch config option to specify base branch (e.g., main, develop)
- Each worktree creates a unique branch based on the specified branch
  (format: branch-run-id)
- If branch is not specified, uses the repository default branch
- Falls back gracefully when branch already exists

Changes:
- Add branch field to RunConfig dataclass
- Update GitWorktreeManager.create() to accept branch parameter
- Create unique branches for each worktree to avoid conflicts
- Update load_config() to parse branch from config
- Update config.example.json with branch option
- Update README.md documentation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-01-28 12:36:23 +08:00
tanzhenxin
47a733362e feat: add sequential prompt execution and auto git initialization
Enhance the concurrent runner with two key features:

1. Sequential Prompt Execution:
   - Run multiple prompts sequentially instead of joining them
   - Use --continue flag for prompts 2+ to pick up chat history
   - Generate separate output files per prompt (stdout-1.txt, stdout-2.txt, etc.)
   - Stop execution if any prompt fails
   - Track per-prompt results in results.json

2. Auto Git Initialization:
   - Automatically initialize git repo if source is not a git repository
   - Run git init → git add . → git commit automatically
   - Improves UX - users can point runner at any directory

Changes:
- Add PromptResult dataclass for per-prompt tracking
- Modify RunRecord to include prompt_results list
- Update QwenRunner.run() to execute prompts sequentially
- Add GitWorktreeManager.ensure_git_repo() method
- Update _build_command() to support --continue flag

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-01-28 12:27:10 +08:00
tanzhenxin
4ac3df1b63 feat: add concurrent runner for batch CLI execution
Add a Python-based concurrent runner that executes multiple Qwen CLI tasks
across different models in parallel using isolated git worktrees.

Features:
- Execute N tasks × M models concurrently with configurable concurrency
- Create isolated git worktrees for each run under ~/.qwen/worktrees
- Real-time progress display with Rich library
- Capture stdout, stderr, and OpenAI API logs per run
- Atomic JSON tracking of all runs with status and metadata
- Automatic cleanup of worktrees after each run

Structure:
- runner.py: Main implementation with asyncio
- requirements.txt: Python dependencies
- README.md: Documentation and usage
- config.example.json: Configuration template
- examples/: Toy example with sample config and project

Usage:
  python runner.py config.json

Each run creates an isolated output directory:
  outputs/{run_id}/
    ├── stdout.txt
    ├── stderr.txt
    └── logs/openai-*.json

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-01-28 12:08:56 +08:00