Commit graph

31 commits

Author SHA1 Message Date
tanzhenxin
63f1963377
Merge pull request #2698 from QwenLM/refactor/subagent-model-selection
feat: add cross-provider model selection for subagents
2026-04-01 16:17:54 +08:00
mingholy.lmh
4219101397 test(sdk): improve permission message pattern matching
Support both 'declined' and 'denied' variants for permission denied messages in tool control tests.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 16:36:06 +08:00
tanzhenxin
ad20049a4e Merge remote-tracking branch 'origin/main' into refactor/subagent-model-selection 2026-03-27 11:56:29 +08:00
tanzhenxin
5d58b2f112 feat: simplify subagent model configuration with model selector
Refactor subagent model configuration from nested modelConfig object to a simple model string field for better UX and clarity.

Changes:
- Replace modelConfig object with model string in SubagentConfig interface
- Add model-selection.ts utility for parsing and validating model selectors
- Support 'inherit' keyword and bare model IDs (e.g., 'glm-5', 'claude-sonnet-4-6')
- Maintain backward compatibility by parsing legacy modelConfig frontmatter
- Update validation to reject cross-provider authType-prefixed selectors
- Update SDK types (TypeScript and Java) to reflect new schema
- Add comprehensive tests for model selection and validation
- Update documentation with model selection examples

Breaking changes:
- modelConfig.frontmatter field deprecated in favor of model field
- Cross-provider model selectors (e.g., 'openai:gpt-4') not supported for subagents

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-27 11:49:45 +08:00
Mingholy
849a7327eb
Potential fix for code scanning alert no. 110: Replacement of a substring with itself
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-03-26 21:41:10 +08:00
mingholy.lmh
3edbf561e6 test(sdk): remove debug executable path 2026-03-26 21:14:35 +08:00
mingholy.lmh
9db176a07b test(sdk): improve abort test reliability with partial message handling
- Use includePartialMessages and isSDKPartialAssistantMessage for more reliable abort triggering
- Remove flaky tool name assertions that could fail when tools aren't registered (issue #2653)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 21:02:30 +08:00
mingholy.lmh
6aab02f13f test(sdk): add tool control pattern matching tests
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-24 22:31:59 +08:00
mingholy.lmh
0da574d800 test: simplify tool control test by removing redundant tool restrictions
Remove excludeTools and allowedTools configurations from the test
as coreTools is sufficient for limiting available tools. Update
canUseTool expectation to verify write_file is properly called.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-23 19:30:03 +08:00
tanzhenxin
19ed08098b refactor(core): rename task tool to agent
- Update tool name aliases to map 'task' to 'agent' as legacy alias
- Add proper 'agent' tool name aliases (Agent, AgentTool)
- Update canonical-to-rule display mapping from 'task' to 'Agent'
- Update tests to expect 'agent' instead of 'task'
- Fix debug log message from [TaskTool] to [Agent]

This completes the tool renaming from "task" to "agent" for clarity,
as "agent" better describes the tool's purpose of delegating to
subagents.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-20 15:50:06 +08:00
mingholy.lmh
79083ffd50 Fix SDK message event pairing and improve content block handling
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-18 18:10:23 +08:00
mingholy.lmh
eea92fc8db fix: ensure message_start and message_stop are always paired in SDK stream events
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-18 18:10:23 +08:00
tanzhenxin
cef0be1b63 test(sdk): simplify integration tests for reliability
- Replace verbose prompts with simple 'Say hello' prompts
- Remove fragile text content assertions that depend on specific model responses
- Simplify test logic to focus on message flow rather than content validation
- Add permissionMode: 'default' and test file setup for read-only tool tests

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-16 11:23:57 +08:00
mingholy.lmh
ee5e47bb5f fix: sandbox user permission in integration tests
- Allow SANDBOX_SET_UID_GID to control user identity in integration tests
- Fix project naming from gemini-cli to qwen-code
- Use random UUID in tests to avoid conflicts

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-15 11:02:32 +08:00
mingholy.lmh
82dc79629c feat: enhance session ID handling and error propagation 2026-02-13 21:41:38 +08:00
mingholy.lmh
5d939fdb83 feat: add --session-id support for CLI and SDK
- Add --session-id flag to CLI for specifying custom session ID
- Add sessionId option to SDK QueryOptions
- Implement UUID validation for session IDs
- Pass session ID from SDK to CLI via --session-id argument
- Add integration tests for session-id functionality
- Update unit tests for ProcessTransport

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-13 21:40:57 +08:00
mingholy.lmh
7311a01874 fix: sdk mcp tests 2026-02-09 11:54:20 +08:00
mingholy.lmh
1e05359881 ci(sdk-release): add CLI source selection for SDK releases
- Replace cli_ref input with cli_source choice (build_from_source or npm_latest)
- Add support for bundling latest stable CLI from npm
- Add bundle-cli-from-npm.js script for npm-based CLI bundling
- Fix property naming in nonInteractiveCli.ts (outputUpdateHandler)
- Improve integration tests for subagents
- Skip creating issue on failure during dry-run mode

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-05 20:57:01 +08:00
mingholy.lmh
b05de7a187 test: improve sdk integration tests 2026-01-27 17:10:36 +08:00
mingholy.lmh
f578ff07a2 fix: cli input stream handling and error management, improve e2e and unit tests 2026-01-23 13:56:38 +08:00
mingholy.lmh
50bf65b10b test: skip flaky & ambigous sdk e2e test case 2026-01-13 20:04:19 +08:00
mingholy.lmh
8c109be48c refactor: unified allow list of supported commands in ACP or non-interactive mode 2025-12-26 17:55:03 +08:00
tanzhenxin
b64d636280 anthropic provider support follow-up 2025-12-25 15:24:42 +08:00
tanzhenxin
b9a2cc7bdf Add chat recording toggle (CLI + settings) and disable recording in tests 2025-12-15 13:48:38 +08:00
mingholy.lmh
8b5b8d2b90 test: skip unstable e2e test 2025-12-06 18:41:19 +08:00
mingholy.lmh
22943b888d test: clean up integration test by removing unnecessary console logs 2025-12-05 22:11:27 +08:00
mingholy.lmh
96d458fa8c chore: rename @qwen-code/sdk-typescript to @qwen-code/sdk 2025-12-05 21:47:26 +08:00
mingholy.lmh
c218048551 fix: prevent sending control request when query is closed 2025-12-05 18:46:51 +08:00
mingholy.lmh
322ce80e2c feat: implement SDK MCP server support and enhance control request handling
- Added new `SdkMcpController` to manage communication between CLI MCP clients and SDK MCP servers.
- Introduced `createSdkMcpServer` function for creating SDK-embedded MCP servers.
- Updated configuration options to support both external and SDK MCP servers.
- Enhanced timeout settings for various SDK operations, including MCP requests.
- Refactored existing control request handling to accommodate new SDK MCP server functionality.
- Updated tests to cover new SDK MCP server features and ensure proper integration.
2025-12-05 13:14:54 +08:00
mingholy.lmh
57b519db9a test: skip qwen-oauth e2 case in sandbox 2025-12-04 20:39:51 +08:00
mingholy.lmh
3056f8a63d feat(tests): move SDK integration tests to integration-tests to share globalSetup 2025-12-04 17:10:23 +08:00