Commit graph

2638 commits

Author SHA1 Message Date
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
DennisYu07
0a83a8ed70 merge main 2026-03-19 20:00:29 +08:00
DennisYu07
fe14e1db85 reslove comment 2026-03-19 19:54:28 +08:00
LaZzyMan
b59864f554 Merge branch 'main' into feat/support-permission 2026-03-19 19:08:55 +08:00
DennisYu07
6f914e4f4e merge main 2026-03-19 17:12:19 +08:00
Mingholy
7492af725b
Merge pull request #2470 from QwenLM/fix-minimax-context
fix: correct token limits for MiniMax-M2.5 and GLM models
2026-03-19 16:57:42 +08:00
DennisYu07
305d35e680 fix parse error 2026-03-19 16:26:55 +08:00
mingholy.lmh
699bf4a0a5 fix: correct MiniMax-M2.5 contextWindowSize from 1000000 to 196608
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-19 15:03:55 +08:00
tanzhenxin
8891f4219d refactor(core): rename TaskTool to AgentTool
Rename the Task tool to Agent tool for clearer semantics and better
alignment with industry terminology. This change includes:

- Rename TaskTool -> AgentTool, TaskParams -> AgentParams
- Rename TaskResultDisplay -> AgentResultDisplay
- Add 'Explore' built-in agent for read-only codebase exploration
- Add backward compatibility mappings for legacy tool names
- Improve Agent tool description with clearer usage guidelines
- Add case-insensitive agent name matching
- Fallback to built-in agents when subagent loading fails

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-19 14:55:14 +08:00
mingholy.lmh
9060663f60 refactor(export): clean up unnecessary fields and simplify data structure
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-19 14:33:33 +08:00
mingholy.lmh
8e221a3606 feat: optimize export data structure and UI display
- Simplify export data by removing filesRead stat, keep only written files count and paths
- Restore lines-related statistics (linesAdded and linesRemoved)
- Update HTML display to show only file operation stats instead of total files count
- Change 'Written' label to 'Files modified'
- Remove distinction between requestId and sessionId, always display sessionId
- Remove Session ID and Export Time from Header (already shown in MetadataSidebar)
- Display Project field with raw value and support multiline display
- Fix filesWritten calculation to count unique files instead of operations

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-19 14:10:41 +08:00
mingholy.lmh
a24400ccfc fix(export): correct export metadata accuracy issues
Fix four accuracy bugs in export metadata/sidebar feature:

1. File read counting: Now properly counts read_file operations by checking
   functionResponse.name and args.absolute_path, instead of relying on
   resultDisplay which returns string for reads.

2. Unique file tracking: Uses full file path from args.file_path or
   args.absolute_path instead of basename-only fileName, preventing
   collision between same-named files in different directories.

3. TaskTool token aggregation: Includes tokens from TaskTool executionSummary
   in total token count, fixing under-reporting when subagents are used.

4. Context window display: Removes hardcoded '128k' fallback in HTML sidebar,
   now only displays context usage when contextWindowSize is actually defined.

Also fixes lint errors (Array<T> type annotations) and applies formatting.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-19 14:10:40 +08:00
mingholy.lmh
186103fe4e feat(export): enhance JSONL and Markdown formatters with comprehensive metadata
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-19 14:10:40 +08:00
mingholy.lmh
ccecc472dc feat(export): refactor HTML export components and improve metadata
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-19 14:10:39 +08:00
mingholy.lmh
d59e668729 feat(export): add metadata and statistics to export data
- Add ExportMetadata type with session info, token stats, file operation stats
- Track response_id from LLM API for telemetry correlation
- Collect usageMetadata from assistant messages
- Calculate file stats (files read/written, lines added/removed)
- Calculate token stats (total tokens, context usage percentage)
- Add metadata sidebar to HTML export template
- Support metadata in JSONL and Markdown formatters
- Update chatRecordingService to record response_id

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-19 14:10:38 +08:00
DennisYu07
b5186d3c8a improve to change extension path instead of tmp path and fix shell multiple input 2026-03-19 12:02:54 +08:00
沐目
a6e8aec7f4 fix: destroy both stdin and stdout on shutdown, guard against duplicate signals
- Close stdout in addition to stdin to prevent hanging writes during shutdown
- Add shuttingDown guard to ensure cleanup runs only once

Made-with: Cursor
2026-03-19 11:53:13 +08:00
LaZzyMan
598c438dde Merge branch 'main' into feat/support-permission 2026-03-19 11:52:24 +08:00
沐目
2e6ab6562b fix: handle SIGTERM/SIGINT in ACP mode for graceful shutdown (#1884)
The ACP process was ignoring SIGTERM because signal handlers registered
elsewhere in the CLI startup path (e.g., stdin raw mode restoration)
override Node.js's default exit behavior. This caused the process to
remain alive after the IDE sends SIGTERM, leading to zombie connections
and exit code 143 errors in JetBrains IntelliJ IDEA.

Add explicit SIGTERM/SIGINT handlers in runAcpAgent() that destroy
stdin, which closes the ndjson stream and resolves connection.closed,
allowing the process to exit gracefully.

Made-with: Cursor
2026-03-19 11:46:57 +08:00
LaZzyMan
f9d9a985ce Merge branch 'main' into feat/support-permission 2026-03-19 11:24:30 +08:00
LaZzyMan
4b67e60e63 fix lint 2026-03-19 10:47:30 +08:00
LaZzyMan
ee5e3026c3 Merge branch 'main' into feat/claw-skill 2026-03-19 10:42:48 +08:00