Commit graph

2559 commits

Author SHA1 Message Date
DennisYu07
14be6aed4e change some phrase 2026-03-26 17:11:13 +08:00
DennisYu07
7e5613cf2a fix comment 2026-03-26 16:51:57 +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
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
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
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
顾盼
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
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
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
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
DennisYu07
a0b3cc3268 add hook detail page 2026-03-24 18:08:15 +08:00
DennisYu07
247e8b8742 add test for hooks ui 2026-03-24 15:23:31 +08:00
DennisYu07
7a53185dbf add multi-language for hooks ui 2026-03-24 14:49:16 +08:00
tanzhenxin
615ccd08f2 feat(channels): add config validation, instructions, and sessionScope support
- Validate required fields (type, token) with clear error messages
- Prepend channel instructions to first prompt of each session
- SessionRouter respects sessionScope (user/thread/single) for routing keys
2026-03-24 06:33:37 +00:00
tanzhenxin
3eedc43238 feat(channels): add Telegram channel integration with ACP bridge
Implements the channels infrastructure for connecting external messaging
platforms to Qwen Code via ACP. Phase 1 supports plain text round-trip:
Telegram user sends message -> AcpBridge -> qwen-code --acp -> response
back to Telegram.

New packages:
- @qwen-code/channel-base: AcpBridge, SessionRouter, SenderGate, ChannelBase
- @qwen-code/channel-telegram: TelegramAdapter using telegraf

CLI: `qwen channel start <name>` reads from settings.json channels config,
spawns ACP agent, connects to Telegram via polling.
2026-03-24 06:33:36 +00:00
qqqys
7b1d294324 fix(cli): add kitty sequence timeout management and buffer handling improvements in KeypressProvider 2026-03-24 10:57:11 +08:00
yiliang114
ee1f98f4ff fix(acp-integration/agent): clear pendingConfirmation when tool result arrives for pending tool
- Track pendingConfirmationCallId in AgentToolInvocation to properly clear stale prompts
- Clear pendingConfirmation when TOOL_RESULT arrives for the pending tool (IDE diff-tab path)
- Clear pendingConfirmation via onConfirm callback (terminal UI path)
- Ensure pendingConfirmation is NOT cleared when TOOL_RESULT is for a different tool
- Prefer filePath over fileName for diff content path in Session and SubAgentTracker
- Add comprehensive tests for IDE diff-tab and terminal UI confirmation flows

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-23 23:49:22 +08:00
mingholy.lmh
e950d1e8c5 fix(cli): sync PTY race condition error handling to global uncaughtException
- Handle EIO read race errors on macOS/Linux (node-pty#178)
- Handle EBADF/ioctl resize race errors
- Handle 'Cannot resize a pty that has already exited' on Windows
- Require PTY-specific message context to avoid false positives

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-23 21:23:27 +08:00
qqqys
61fb9425a2 fix(cli): enhance KeypressProvider with kitty sequence timeout management 2026-03-23 20:41:36 +08:00
DennisYu07
8bd7cf2cda add singal abort for hooks 2026-03-23 16:02:54 +08:00
DennisYu07
b08154dbee refactor ui for qwen code hooks 2026-03-23 11:24:59 +08:00
LaZzyMan
6653edeb0c Merge branch 'main' into fix/test-artifacts-and-shell-permissions 2026-03-23 11:10:05 +08:00
wenshao
13423f0676 fix(cli): harden /btw command error handling and type safety
- Add null/undefined guard in formatBtwError to avoid "null"/"undefined" strings
- Add type guard for btw property in HistoryItemDisplay to prevent crash
- Extract isBtwCommand regex to module-level constant and simplify with [/?]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 01:21:07 +08:00
yiliang114
905f2c3f36 Merge branch 'main' into fix/pr2371-btw-complete 2026-03-21 01:10:48 +08:00
yiliang114
dff9822f9b fix(cli): improve /btw overlay UX — layout, dismiss hints, and history cleanup
- Make /btw overlay mutually exclusive with Composer (replaces input area)
- Add dismiss hints: "Press Escape to cancel" (pending) / "Press Space,
  Enter, or Escape to dismiss" (completed)
- Skip adding /btw to conversation history to avoid duplicate display
- Prioritize dialog shortcuts over btw dismiss via dialogsVisibleRef
- Add `sleep` property to terminal-capture FlowStep for async wait scenarios

Made-with: Cursor
2026-03-21 01:07:02 +08:00
LaZzyMan
c0df754418 Merge branch 'main' into fix/test-artifacts-and-shell-permissions 2026-03-20 18:04:44 +08:00
LaZzyMan
dae107d60b Merge branch 'main' into fix/test-artifacts-and-shell-permissions 2026-03-20 17:58:50 +08:00
LaZzyMan
fcd31e2adf fix: prevent bogus shell permission rules in tests 2026-03-20 17:55:33 +08:00
DennisYu07
857c7fb99b Merge branch 'main' into feat/hooks-plugin 2026-03-20 17:43:30 +08:00
tanzhenxin
3a686d5ad1 Merge remote-tracking branch 'origin/main' into refactor/task-to-agent-tool 2026-03-20 16:32:37 +08:00
易良
fbf5ed57d6
feat(storage): support configurable runtime output directory (#2127)
Some checks failed
Qwen Code CI / Lint (push) Failing after 12s
Qwen Code CI / Test (push) Has been skipped
Qwen Code CI / Test-1 (push) Has been skipped
Qwen Code CI / Test-2 (push) Has been skipped
Qwen Code CI / Test-3 (push) Has been skipped
Qwen Code CI / Test-4 (push) Has been skipped
Qwen Code CI / Test-5 (push) Has been skipped
Qwen Code CI / Test-6 (push) Has been skipped
Qwen Code CI / Test-7 (push) Has been skipped
Qwen Code CI / Test-8 (push) Has been skipped
Qwen Code CI / CodeQL (push) Failing after 6s
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Failing after 5s
Qwen Code CI / Post Coverage Comment (push) Has been skipped
E2E Tests / E2E Test (Linux) - sandbox:none (push) Failing after 10m36s
E2E Tests / E2E Test - macOS (push) Has been cancelled
* feat(storage): support configurable runtime output directory (#2014)

Add `advanced.runtimeOutputDir` setting and `QWEN_RUNTIME_DIR` env var
to redirect runtime output (temp files, debug logs, session data, todos,
insights) to a custom directory while keeping config files at ~/.qwen.

- Introduce `Storage.setRuntimeBaseDir()` / `getRuntimeBaseDir()` with
  tilde expansion and relative path resolution
- Add `AsyncLocalStorage`-based `runWithRuntimeBaseDir()` for concurrent
  session isolation in ACP integration
- Update all runtime path methods to use `getRuntimeBaseDir()` instead
  of `getGlobalQwenDir()` (temp, debug, ide, projects, history dirs)
- Config paths (settings, oauth, installation_id, etc.) remain pinned
  to `~/.qwen` regardless of runtime dir configuration
- Add comprehensive tests covering path resolution, env var priority,
  async context isolation, and config path stability

* fix(core/storage): 支持 Windows 风格波浪号路径

扩展 setRuntimeBaseDir 以支持 Windows 风格的波浪号路径 (~\),
使用统一的路径分割逻辑处理 Unix 和 Windows 风格的路径分隔符

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* fix(core/debugLogger): runtime base dir 变更时创建新 debug 目录

添加 ensuredDebugDirPath 追踪变量,当 runtime base dir 发生变更时,
确保在新的目录下创建 debug 子目录

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* feat(cli/acp): 支持 ACP runtime output dir 配置

新增 runWithAcpRuntimeOutputDir 辅助函数,在 ACP Agent 的
loadSession 和 listSessions 操作中应用配置的 runtimeOutputDir

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* docs(vscode-ide-companion/acpConnection): 补充 this 别名的使用说明

为 self = this 的用法添加解释性注释,说明在嵌套回调中需要使用 this

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* feat(cli): add runtime output directory configuration support

* fix(core): update test to use getUserSkillsDirs method

Update storage.test.ts to call getUserSkillsDirs() instead of the
non-existent getUserSkillsDir() method. The method was renamed to
return an array of skill directories.

* fix(core/todoWrite): use path.join for cross-platform path assertion in test

Replace hardcoded forward-slash path `.qwen/todos/` with `path.join('.qwen', 'todos')` to fix Windows CI failure where paths use backslashes.

Made-with: Cursor

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-20 13:53:05 +08:00
易良
87f03cf2e9
feat(vscode-ide-companion): add image paste support (#1978)
* feat(vscode-ide-companion): add image paste support

  - Add clipboard image paste functionality with drag-and-drop support
  - Implement image preview component with removal capability
  - Support multimodal content in ACP session manager for text and images
  - Save pasted images to temporary .gemini-clipboard directory
  - Add image attachment display in user messages
  - Update CSP to allow data: URIs for inline image display
  - Add comprehensive image utilities with size validation (max 10MB)
  - Include tests for image processing utilities

* refactor: simplify VS Code paste image implementation

- Remove dead code and redundant error handling
- Extract common isAuthError() helper function
- Simplify SessionMessageHandler methods (80% reduction)
- Change temp directory from .gemini-clipboard to clipboard (aligned with CLI)
- Keep multimodal image sending format (type: image + base64)

Stats:
- 6 files changed
- 367 insertions (+)
- 1176 deletions (-)

* refactor: align paste image handling

* chore: trim paste image diff

* refactor(vscode-ide-companion): remove unused attachments logic

- Remove unused ImageAttachment type imports
- Remove attachments field from TextMessage interface
- Remove attachments from message data sent to WebView
- Clean up debug console.log statements
- Simplify SessionMessageHandler handleSendMessage method

This removes dead code from the previous image paste implementation
that was no longer needed after switching to @path reference approach.

* refactor(vscode-ide-companion/webview): extract image handling into dedicated hooks and utils

- extract ImagePreview and ImageMessageRenderer components from App.tsx
- create useImageAttachments hook for managing image attachments
- create useImageResolution hook for image path resolution
- add imageAttachmentHandler for saving images to temp files
- add imageMessageUtils for message expansion and resolution
- add imagePathResolver for resolving image paths in webview
- integrate image resolution in useWebViewMessages
- extract shouldSendMessage utility from useMessageSubmit
- add getLocalResourceRoots in PanelManager for resource access

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* fix: harden vscode image handling and webview hosts

* fix: remove this alias in acp connection

* feat: add path escaping utility functions and tests

* feat: add support for image attachments and improve prompt handling

* refactor(webview): Optimize editing mode switching function

* refactor(vscode-ide-companion): move path escaping utilities to local module

- Move escapePath and unescapePath functions from qwen-code-core to local utils
- Add pathEscaping.ts with shell special characters handling
- Update imports in imageFormats.ts, imageAttachmentHandler.ts, and imageMessageUtils.ts
- Add unit tests for path escaping round-trip and browser bundle verification
- Fix browser bundling issue by avoiding node-only module dependencies in webview

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* refactor: consolidate image handling logic across vscode-ide-companion and webui

- Merge分散的 image hooks (useImageAttachments, useImageResolution, usePasteHandler) into unified useImage hook
- Replace image utils (imageMessageUtils, imagePathResolver, imageUtils) with imageHandler and imageSupport
- Remove clipboard image storage from core package
- Consolidate webui image components into ImageComponents.tsx
- Update imports and tests to reflect new structure

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* chore: drop unrelated core tool changes

* test: fix webview provider mocks and drop unrelated core diffs

* fix(cli): resolve original prompt through standard path in no_command case

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-20 13:47:09 +08:00
yiliang114
130d6888b4 perf(cli): memoize btw message component 2026-03-20 13:21:25 +08:00
tanzhenxin
572fa81f38
Merge pull request #2472 from QwenLM/fix/acp-connection-state-cleanup-1780
fix: clean up ACP connection state when child process exits
2026-03-20 11:51:14 +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
tanzhenxin
9d6aca8efe Merge branch 'main' into refactor/task-to-agent-tool 2026-03-20 10:23:25 +08:00
yiliang114
bd77eef46f Merge remote-tracking branch 'origin/main' into fix/pr2371-btw-complete
# Conflicts:
#	packages/cli/src/ui/AppContainer.tsx
#	packages/cli/src/ui/hooks/useGeminiStream.ts
#	packages/cli/src/ui/layouts/DefaultAppLayout.tsx
#	packages/cli/src/ui/types.ts
#	packages/core/src/core/client.test.ts
2026-03-20 00:55:29 +08:00
yiliang114
0a1ffd98eb feat(cli): make /btw command non-blocking with parallel execution
- Add btwItem state management independent from pendingItem
- Add cancelBtw functionality to abort in-flight BTW API calls
- Allow /btw commands to execute concurrently with main responses
- Add isBtwCommand utility function
- Update BtwMessage UI with cleaner styling (remove spinner)
- Add tests for concurrent /btw execution scenarios
- Update layouts to render BTW messages in fixed bottom area

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-20 00:25:51 +08:00