Commit graph

5543 commits

Author SHA1 Message Date
LaZzyMan
460c81a7b6 fix(tools): fix glob ignore base path and add dedup for grep/ripgrep
- glob: compute relativePaths relative to projectRoot (config.getTargetDir())
  instead of searchDir so that FileDiscoveryService evaluates .gitignore /
  .qwenignore rules against the correct paths when path option is used or
  when searching across multiple workspace directories

- grep: deduplicate rawMatches by filePath:lineNumber key when searching
  multiple workspace directories to prevent duplicate results from
  overlapping search roots (e.g. parent dir + child dir in workspace)

- ripGrep: deduplicate output lines by filepath:linenum prefix when
  searching multiple workspace paths to handle the same edge case

- tests: add regression tests covering
  - glob ignores files matching .gitignore/.qwenignore when path option
    points to a subdirectory
  - grep deduplication with parent+child overlapping workspace dirs
  - ripgrep deduplication when raw output contains duplicate lines
2026-03-26 17:54:38 +08:00
tanzhenxin
33901fb9cd docs(channels): add DingTalk channel documentation
- Add comprehensive DingTalk setup guide with prerequisites, configuration, and troubleshooting
- Add WeChat and DingTalk entries to channels navigation

This provides users with complete documentation for setting up and using DingTalk as a Qwen Code channel.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 09:14:31 +00:00
DennisYu07
14be6aed4e change some phrase 2026-03-26 17:11:13 +08:00
tanzhenxin
9f4dd53198 feat(channels): add DingTalk reply/quote message context support
- Add interfaces for DingTalkRepliedMsg and DingTalkRichTextPart types
- Support both newer text.repliedMsg and legacy quoteMessage formats
- Extract quoted message context with isReplyToBot detection
- Summarize replied content (text, richText, media placeholders)

This enables the bot to understand when users are replying to specific
messages and provides context about what message is being referenced.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 09:08:36 +00:00
DennisYu07
7e5613cf2a fix comment 2026-03-26 16:51:57 +08:00
tanzhenxin
a61189b232 feat(channels): add DingTalk media download support
- Handle richText, picture, file, audio, video message types
- Download media via DingTalk API two-step flow
- Attach images as base64, save other files to temp dir
- Add DingTalkMessageData interface for richer payloads

This enables the DingTalk channel to process media attachments
in incoming messages.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 08:49:56 +00:00
tanzhenxin
6c6057cf9c feat(channels): add DingTalk markdown normalization
- Convert tables to pipe-separated plain text (DingTalk doesn't render tables)
- Split long messages into chunks respecting ~3800 char limit
- Handle code fences across chunk boundaries
- Extract title from first markdown line for webhook payload

This ensures markdown content renders correctly in DingTalk's limited renderer.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 08:34:34 +00:00
tanzhenxin
217964b849 feat(channels): add reaction feedback and webhook caching for DingTalk
- Cache sessionWebhook by conversationId for reliable message routing
- Show 👀 reaction while processing messages, then recall it
- Use conversationId as chatId instead of webhook URL
- Fix rawData parsing for already-parsed message data

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 08:29:27 +00:00
DennisYu07
17b45c44e5 move picture to cnd 2026-03-26 16:28:07 +08:00
DennisYu07
35e11da11f add experimental for hooks 2026-03-26 16:23:59 +08:00
DennisYu07
72c4c0384f add doc for hooks 2026-03-26 16:13:24 +08:00
tanzhenxin
92c54ff309 feat(channels): add DingTalk channel adapter
- Add @qwen-code/channel-dingtalk package with stream-based bot integration
- Support clientId/clientSecret authentication for DingTalk
- Add message deduplication and group chat mention handling
- Update ChannelConfig type to include dingtalk channel type

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 08:03:43 +00:00
DennisYu07
12eb0f8f8d correct hooks JSON schema 2026-03-26 14:07:36 +08:00
DennisYu07
db7ec117c2
Merge pull request #2645 from QwenLM/fix/git_bash_change_windows
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
fix(windows): support git bash/MSYS2 shell detection on Windows
2026-03-26 13:04:38 +08:00
LaZzyMan
64b83a102c fix: use config working directory for OpenAI logger path resolution in ACP mode
In ACP mode (e.g., Zed editor), process.cwd() may return '/' (filesystem root),
causing OpenAILogger to attempt creating '/logs/openai' which fails with ENOENT.

Add an optional 'cwd' parameter to OpenAILogger constructor and pass
config.getWorkingDir() from LoggingContentGenerator so that log directories
are resolved relative to the project working directory instead of process.cwd().

Fixes #2671
2026-03-26 11:51:22 +08:00
tanzhenxin
1a272a12e9 feat(channels): add reply context support for referenced messages
- Add referencedText field to Envelope for quoted/replied-to messages
- TelegramAdapter extracts text from reply_to_message
- WeixinAdapter extracts text from ref_msg field
- ChannelBase prepends referenced text to agent prompt

This allows the agent to see what message a user is replying to,
providing better context for conversations in both Telegram and WeChat.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 03:34:16 +00:00
tanzhenxin
9c001ba61e feat(channels): add shared slash command system
- Add /help, /clear (aliases: /reset, /new), /status commands to ChannelBase
- Commands are handled locally without agent round-trip
- TelegramAdapter skips "Working..." indicator for local commands
- Update docs to reflect new command structure

This provides a consistent command interface across all channel types
(Telegram, WeChat, etc.) with platform-specific extensibility.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 03:24:44 +00:00
tanzhenxin
697898a9fb feat(channel): add status and stop commands for service management
- Add `qwen channel status` to check running service info
- Add `qwen channel stop` to gracefully stop the service
- Add PID file tracking to prevent duplicate service instances
- Update documentation with new commands and usage

This enables users to manage the channel service from another terminal
without needing to use Ctrl+C on the foreground process.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 03:06:48 +00:00
tanzhenxin
1a605ec973 feat(channels): add crash recovery and gateway mode support
- Add session persistence to SessionRouter for crash recovery
- Add loadSession method to AcpBridge for restoring sessions
- Add ChannelBaseOptions to support external router injection
- Refactor start.ts to support both standalone and gateway modes
- Extract config utilities into separate module

This enables channels to recover sessions after bridge crashes and
supports running multiple channels under a gateway process.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-26 02:55:18 +00:00
Mingholy
52a573f10f
Merge pull request #2591 from QwenLM/fix/2515-vscode-context-indicator
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
fix(vscode-ide-companion): preserve model metadata on switch
2026-03-26 10:23:32 +08:00
Mingholy
9cd4434fe2
Merge pull request #2547 from QwenLM/fix/lsp-cpp-java-support-v2
fix(lsp): improve C++/Java/Python language server support
2026-03-26 10:22:41 +08:00
Mingholy
23a17b6c1e
Merge pull request #2545 from QwenLM/fix/secondary-sidebar-warning
fix(vscode-ide-companion): silence secondary sidebar warning on older VS Code versions
2026-03-26 10:22:31 +08:00
Mingholy
a79c966c44
Merge pull request #2546 from QwenLM/fix/acp-error-handling
fix(vscode-ide-companion): improve ACP error handling to prevent silent loading hangs
2026-03-26 10:11:12 +08:00
Mingholy
51123ca024
Merge pull request #2421 from QwenLM/feat/hooks-telemetry
feat(hooks): Add comprehensive hook execution telemetry
2026-03-26 10:10:11 +08:00
Mingholy
a1b700192b
Merge pull request #2080 from zy6p/fix/2049-preserve-selected-auth-type-on-auth-failure
fix(cli): preserve selected auth type on startup auth failure
2026-03-26 10:06:02 +08:00
JohnKeating1997
41b5001e54 fix(auth): update descriptions for API key compatibility in AuthDialog 2026-03-25 23:29:57 +08:00
JohnKeating1997
28dbf6649d feat(auth): implement Alibaba Cloud Standard API Key support 2026-03-25 23:27:03 +08:00
DennisYu07
a5c6084222 refactor ui for stop hook and userPromptSubmit 2026-03-25 20:44:55 +08:00
qqqys
23b17687bf feat(vscode): add retry logic and auto-reconnect for ACP connection
- Add connectWithRetry() method with exponential backoff (3 retries max)
- Add cleanupForRetry() to clean partial state between retry attempts
- Improve readiness detection with proper timeout and exit handling
- Add timeout for ACP initialize handshake (15s)
- Add auto-reconnect on unexpected subprocess exit (max 1 attempt)
- Track intentionalDisconnect flag to skip auto-reconnect for user-initiated disconnects
- Add onAutoReconnectFailed callback for user notification when auto-reconnect fails
- Show VS Code warning notification with 'Retry Connection' action button
- Add comprehensive tests for retry logic, cleanup, and intentional disconnect flag

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-25 20:15:57 +08:00
zhangxy-zju
4aff9d769b fix: disconnect ACP agent on panel/view dispose to prevent orphan processes
The panel onDidDispose and webviewView onDidDispose callbacks were not
calling agentManager.disconnect(), so closing a chat tab or sidebar
view left the CLI child process running as an orphan. Only the
WebViewProvider.dispose() method (called on extension deactivation)
had the disconnect call.

Add agentManager.disconnect() to both dispose callbacks so the CLI
process receives SIGTERM when the user closes the tab.
2026-03-25 19:30:13 +08:00
zhangxy-zju
e1371ec781 chore: address review feedback - log cleanup errors, add inline comment 2026-03-25 19:30:11 +08:00
zhangxy-zju
38d0acb01c fix: clean up MCP subprocesses on ACP shutdown to prevent orphan processes
PR #2472 added SIGTERM/SIGINT handlers in runAcpAgent() that destroy
stdin/stdout streams, allowing the ACP connection to close. However,
it did not call runExitCleanup() to terminate child processes (MCP
servers, etc.) spawned by the CLI. This caused orphan subprocesses
to persist after the IDE disconnects, especially noticeable in VSCode
with multiple tabs.

Changes:
- acpAgent.ts: Call runExitCleanup() in the shutdown signal handler
  before process.exit(0), ensuring MCP server subprocesses are killed
- gemini.tsx: Call runExitCleanup() + process.exit(0) after
  runAcpAgent() returns normally, matching the cleanup pattern used
  by other non-interactive exit paths
- Add 4 unit tests covering SIGTERM cleanup, SIGINT cleanup,
  idempotent shutdown, and cleanup-failure resilience

Closes #1884
2026-03-25 19:30:09 +08:00
顾盼
28e62882f0
Merge pull request #2642 from huww98/fix/mcp-trust-permission
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
fix(mcp): restore trust+isTrustedFolder permission check in getDefaultPermission
2026-03-25 16:55:57 +08:00
顾盼
b57b8ed5fe
Merge pull request #2368 from huww98/fix/memory-show-multi-file-support
fix(cli): `/memory show --project` and `--global` now display all configured context files
2026-03-25 16:51:08 +08:00
tanzhenxin
f6ae769736 docs(channels): document media support and add WeChat guide
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

- Add Media Support section to overview with images and files

- Document model option for multimodal channel support

- Add Images and Files section to Telegram guide

- Add complete WeChat (Weixin) setup guide with QR auth

This documents the new media handling capabilities added to both Telegram and WeChat channels.
2026-03-25 08:12:53 +00:00
tanzhenxin
b37e2110f5 feat(channels): add file and photo support for Telegram and WeChat
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

- Add photo message handling in Telegram adapter with base64 encoding

- Add document/file message handling with temp directory storage

- Extend WeChat adapter to support file downloads from CDN

- Refactor envelope building into reusable buildEnvelope method

- Rename ImageCdnRef to CdnRef for generic media handling

This enables users to send images and files through both Telegram and WeChat channels, with files saved to a temp directory for agent access.
2026-03-25 08:09:21 +00:00
tanzhenxin
4f2b9e9bd8 feat(channels): add multimodal support with image handling
- Add model configuration option for channel-specific model selection
- Support base64-encoded images in prompts via AcpBridge
- Add media utilities for WeChat/Weixin channel
- Update settings schema for model configuration

Enables channels to process images and use custom models.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-25 07:43:48 +00:00
LaZzyMan
ea3a2d6f5b fix: improve /compress split point selection for tool-heavy conversations
When conversation history is near the context window limit and dominated by
tool call/response cycles, findCompressSplitPoint would return a near-zero
split point because it only considered non-functionResponse user messages as
valid split points. This caused /compress to send almost no history to the
compression API (e.g. 29 tokens), producing a useless summary that inflated
token count instead of reducing it.

Changes:
- Track tool completion boundaries (positions after functionResponse) as
  fallback split points in findCompressSplitPoint
- Add user-with-functionResponse to the compress-everything safety check
- Use Math.max of primary and fallback split points for better coverage
- Add minimum content guard (5% threshold) to prevent futile API calls
- Add 4 new test cases covering tool-heavy conversation scenarios

Fixes #2647
2026-03-25 15:13:10 +08:00
tanzhenxin
24c9b0f333 feat(channels): add WeChat/Weixin channel support
- Add WeixinAdapter with accounts, api, login, monitor, send modules
- Add channel configure command for interactive setup
- Update TelegramAdapter for consistency

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-25 06:54:51 +00:00
LaZzyMan
05062fd689 fix: resolve /clear command and ESC key lag caused by hooks system
- Make hook events fire-and-forget in clearCommand to avoid blocking UI
- Move context.ui.clear() before resetChat for immediate responsiveness
- Add hasHooksForEvent() fast-path check to HookSystem and Config
- Skip MessageBus round-trips in client.ts when no hooks are registered
- Add comprehensive unit tests for all changes

Fixes #2651
2026-03-25 14:01:24 +08:00
DennisYu07
50ade83e4d fix comment 2026-03-25 11:08:23 +08:00
tanzhenxin
90236465d3 feat(channels): add group chat support for Telegram
- Add GroupGate class for group access control with three policies:
  disabled (default), allowlist, and open
- Implement mention gating: bot only responds when @mentioned or replied to
  in groups (configurable per-group)
- Extend Envelope type with isGroup, isMentioned, isReplyToBot fields
- Update TelegramAdapter to detect group context and mentions
- Add comprehensive documentation for group chat setup and troubleshooting

This enables using Qwen Code bots in Telegram groups with fine-grained
access control and mention-based activation to prevent noise.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-25 02:04:27 +00:00
DennisYu07
3edcfc1cfd fix test 2026-03-25 10:04:26 +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
43bb14ddc9 docs(sdk): enhance coreTools/excludeTools/allowedTools documentation with permissions reference
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-24 22:26:54 +08:00
胡玮文
6ad990e1e7 fix(mcp): restore trust+isTrustedFolder permission check in getDefaultPermission
The trust/isTrustedFolder logic was accidentally dropped during the
permission system refactor in feat/support-permission (PR #2283).

Previously, shouldConfirmExecute() returned false (no confirmation) when
both conditions were met:
  - MCP server config has trust: true
  - The workspace folder is trusted (isTrustedFolder())

The refactor replaced shouldConfirmExecute() with getDefaultPermission() but
left out the trust check entirely, adding a comment claiming 'trust logic is
now handled by PM rules' — however no PM rules were ever generated from the
trust setting, making trust: true completely non-functional.

This fix restores the original behavior: MCP tools from a trusted server
(trust: true) auto-approve only when the workspace is also trusted, preserving
the security gate that prevents trust settings from bypassing confirmation in
untrusted folders.
2026-03-24 21:11:43 +08:00
LaZzyMan
a5a8ec5d67 feat: human-readable permission labels, deny rule feedback, and multi-dir search tests
- Add buildHumanReadableRuleLabel() to convert raw permission rules into
  natural-language descriptions for the 'Always Allow' UI options
- Add PermissionManager.findMatchingDenyRule() to surface which deny rule
  caused a tool to be blocked, improving error messages in coreToolScheduler
- Update ToolConfirmationMessage to use friendly labels with i18n support
- Add comprehensive tests for new permission features and multi-directory
  search in glob, grep, and ripGrep tools
- Fix integration test for tool-control allowedTools configuration
2026-03-24 19:47:07 +08:00
tanzhenxin
8753245b5f feat(channels): add DM pairing flow for sender approval
- Add PairingStore for managing pending requests and approved users
- Update SenderGate to support pairing policy with code generation
- Add CLI commands: `qwen channel pairing list/approve`
- Document pairing flow with rules and usage examples

This allows unknown senders to request access via a pairing code
that the bot operator approves through the CLI.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-24 11:37:16 +00:00
tanzhenxin
59ee49e0ab docs(channels): add Channels feature documentation
- Add overview page explaining channels architecture and configuration
- Add Telegram channel setup guide with bot creation steps
- Add navigation entries for channels section

This documents the new Channels feature that allows users to interact
with Qwen Code agents from messaging platforms like Telegram.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-24 11:12:52 +00:00
tanzhenxin
2867e779b9 refactor(channels): simplify Telegram status tracking and improve event handling
- Add ToolCallEvent interface and emit typed events from AcpBridge
- Refactor sessionUpdate handling into dedicated method
- Simplify TelegramAdapter to use simple 'Working...' message
- Change to non-awaited handler to avoid Telegraf 90s timeout
- Remove console.log statements for cleaner code

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-24 10:18:23 +00:00