Commit graph

500 commits

Author SHA1 Message Date
tanzhenxin
71a59fbbb0 test(vscode): add mock child to AcpConnection test setup
This ensures the test has a properly initialized mock child process,
fixing potential test failures during the task-to-agent-tool refactor.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-20 16:50:36 +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
tanzhenxin
f9b5bc5317
Merge pull request #2501 from qqqys/fix/vscode_proxy
fix(vscode-ide-companion): pass proxy configuration to CLI
2026-03-20 11:52:24 +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
9d6aca8efe Merge branch 'main' into refactor/task-to-agent-tool 2026-03-20 10:23:25 +08:00
顾盼
b8dda154df
Merge pull request #2283 from QwenLM/feat/support-permission
Some checks failed
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 / Lint (push) Failing after 8s
E2E Tests / E2E Test (Linux) - sandbox:none (push) Failing after 3s
Qwen Code CI / Post Coverage Comment (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 4s
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Failing after 10s
E2E Tests / E2E Test - macOS (push) Has been cancelled
Feat: support permission
2026-03-19 21:07:13 +08:00
qqqys
a7dec25a50 refactor(tests): improve proxy configuration handling in QwenConnectionHandler tests 2026-03-19 20:48:18 +08:00
qqqys
3ba30a8576 fix(vsocde-ide-companion): fix proxy error 2026-03-19 20:31:26 +08:00
tanzhenxin
e14d08357a
Merge pull request #2495 from Br1an67/fix/tos-link
fix: update TOS link in VS Code extension README
2026-03-19 19:50:21 +08:00
LaZzyMan
b59864f554 Merge branch 'main' into feat/support-permission 2026-03-19 19:08:55 +08:00
Br1an67
c825d573ee
fix: update TOS link in VS Code extension README
The link pointed to a non-existent path (docs/tos-privacy.md) resulting
in a 404. Updated to the correct docs site URL matching the one already
used in AuthDialog.tsx.

Closes #1066
2026-03-19 17:36:32 +08:00
DennisYu07
6f914e4f4e merge main 2026-03-19 17:12:19 +08:00
LaZzyMan
f9d9a985ce Merge branch 'main' into feat/support-permission 2026-03-19 11:24:30 +08:00
沐目
692e063cd7 fix: address PR review feedback
- Add exitCode fallback in startup failure message to handle edge case
  where exit event hasn't fired yet
- Add guard check in exit handler to avoid redundant cleanup if
  disconnect() already ran
- Add JSDoc for onDisconnected callback
- Add comment explaining exit code 143 (SIGTERM) in test

Made-with: Cursor
2026-03-19 11:07:29 +08:00
沐目
f231830b9f fix: improve ACP exit diagnostics and add onDisconnected callback
- Record lastExitCode/lastExitSignal for better error messages on startup failure
- Reset exit info on reconnect to avoid stale data
- Add onDisconnected callback so upper layers can react to process exit
- Add clarifying comment on ensureConnection defense-in-depth checks
- Expand tests: onDisconnected contract, disconnect kill verification, exit info init

Made-with: Cursor
2026-03-19 10:41:35 +08:00
沐目
75b94b63eb fix: clean up ACP connection state when child process exits (#1780)
When the ACP child process exits unexpectedly (e.g., user cancels execution),
the connection state (sdkConnection, sessionId, child) was not being cleaned up.
This caused subsequent message sends to fail with cryptic errors instead of
a clear "Not connected" message.

Changes:
- Clear sdkConnection/sessionId/child in the exit handler
- Check child.exitCode in isConnected to detect spontaneous exits
- Add isConnected check to ensureConnection as defense-in-depth
- Add unit tests for isConnected, ensureConnection, and disconnect cleanup

Made-with: Cursor
2026-03-19 10:37:52 +08:00
qqqys
de0f09c459
Merge pull request #2457 from qqqys/fix/vscode_file_path
fix(vscode-ide-companion): update URI handling for Windows paths
2026-03-18 21:45:41 +08:00
易良
ef640ba698
feat(vscode-ide-companion): add Tab key fill-only behavior for completions (#2431)
* feat(vscode-ide-companion): add Tab key fill-only behavior for completions

- Separate Tab and Enter key handling in CompletionMenu
- Tab now inserts completion text without executing (useful for slash commands)
- Enter/click continues to select and execute immediately
- Allow users to append arguments after Tab-filling slash commands

* feat(vscode-ide-companion): add Tab key fill-only behavior for completions

- Separate Tab and Enter key handling in CompletionMenu
- Tab now inserts completion text without executing (useful for slash commands)
- Enter/click continues to select and execute immediately
- Allow users to append arguments after Tab-filling slash commands

Co-authored-by: Mingholy <14246397+Mingholy@users.noreply.github.com>

* feat: add command selection behavior logic and tests

Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>

* feat(vscode-ide-companion): add Tab key completion fill behavior with tests

- Add onCompletionFill prop to InputForm for Tab key handling
- Distinguish Tab (fill) and Enter (select) completion behaviors
- Add keyboard handling tests for completion items
- Remove 'skills' command from non-interactive CLI allowed list

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

* refactor: add itemId variable for command handling in App component

Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>

* refactor: remove unused command selection behavior utils and tests

---------

Co-authored-by: Mingholy <14246397+Mingholy@users.noreply.github.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-18 21:45:11 +08:00
qqqys
27f4a3ee3d
Merge pull request #2437 from qqqys/feat/vsocde_file_search
refactor: Refactors the VS Code file completion system to use fuzzy search
2026-03-18 21:43:21 +08:00
tanzhenxin
fe304a0c32 Merge branch 'main' into feature/arena-agent-collaboration 2026-03-18 19:20:22 +08:00
qqqys
8f5ecbc46c refactor(completion): improve trigger detection logic for completion suggestions by prioritizing '@' over '/' and refining context checks 2026-03-18 17:12:46 +08:00
qqqys
2bd3c293ff refactor(completion): enhance trigger detection logic for completion suggestions 2026-03-18 17:06:25 +08:00
qqqys
848f7dbd4c fix(vscode-ide-companion): update URI handling for Windows paths 2026-03-18 15:28:22 +08:00
DennisYu07
1ce8502ebf Merge branch 'main' into feat/hook_sessionstart_sessionend 2026-03-17 20:41:08 -07:00
DennisYu07
b236e4152f Merge branch 'main' into feat/hook_sessionstart_sessionend 2026-03-17 20:34:13 -07:00
tanzhenxin
22f0437369 chore: bump version to 0.13.0
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-18 10:41:32 +08:00
qqqys
476d6bc4fc test(file-handler): enhance tests for FileMessageHandler with fuzzy search and path filtering 2026-03-18 00:20:11 +08:00
qqqys
7a554b1226 refactor(file-handler): improve file watcher management and cache clearing 2026-03-17 21:21:53 +08:00
qqqys
ebeb7ed690 refactor(completion): enhance trigger detection logic for completion suggestions 2026-03-17 20:55:12 +08:00
qwen-code-ci-bot
ac30c98a26
chore: bump version to 0.12.6 (#2442)
Some checks failed
Qwen Code CI / Lint (push) Failing after 5s
Qwen Code CI / CodeQL (push) Failing after 5s
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
E2E Tests / E2E Test (Linux) - sandbox:none (push) Failing after 3s
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Failing after 4s
Qwen Code CI / Post Coverage Comment (push) Has been skipped
E2E Tests / E2E Test - macOS (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-17 19:00:26 +08:00
qqqys
1788be9c57 refactor(search): implement backend fuzzy search and improve file handling
- Removed client-side filtering for search queries; fuzzy search is now handled by the backend.
- Enhanced file search initialization and caching mechanisms in FileMessageHandler.
- Added file watchers for cache invalidation on file system changes.
- Updated completion trigger logic to prioritize '@' over '/' for path-like queries.
- Reset last query on file selection to ensure fresh search results.

This refactor improves search efficiency and maintains accurate file references in the application.
2026-03-17 16:38:14 +08:00
tanzhenxin
edd8388b27 Merge branch 'main' into feature/arena-agent-collaboration 2026-03-17 14:00:47 +08:00
qwen-code-ci-bot
bcbd82d2d4
chore: bump version to 0.12.5 (#2422)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-16 19:05:05 +08:00
LaZzyMan
d129ddc489 Merge branch 'main' into feat/support-permission 2026-03-16 11:42:37 +08:00
LaZzyMan
02ea2ed70c fix settings 2026-03-16 11:28:05 +08:00
tanzhenxin
58bee3dec9
Merge pull request #2388 from QwenLM/fix/remove-enableToolOutputTruncation-setting
fix(core): improve shell tool truncation, simplify tool output handling, and remove summarization
2026-03-16 09:51:37 +08:00
tanzhenxin
d0a4dcc89c
Merge pull request #2374 from QwenLM/fix/vscode-session-race-conditions
fix(vscode): prevent race conditions in prompt cancellation and streaming
2026-03-16 09:51:20 +08:00
tanzhenxin
110fcd7b7b
Merge pull request #2280 from xuewenjie123/fix/hooks-json-schema-type
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: correct hooks JSON schema type definition
2026-03-15 22:44:01 +08:00
tanzhenxin
8161ac4523 fix(hooks): correct JSON schema type for hooks configuration
- Add 'array' type support to SettingItemDefinition
- Change hooks field from object to array type
- Add additionalProperties constraint for env fields
- Fix additionalProperties generation to only apply for object types

This ensures the hooks configuration schema correctly represents hooks as an array
and properly validates environment variable objects.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-15 20:32:56 +08:00
tanzhenxin
a165599b32 chore(release): bump version to 0.12.4
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-15 18:45:14 +08:00
tanzhenxin
e484dfbbad refactor: remove summarizeToolOutput feature
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Remove the summarizeToolOutput setting and related functionality.

This feature allowed LLM-based summarization of shell tool output but is no longer needed.

This simplifies the codebase by removing unused summarization logic and configuration options.
2026-03-15 13:51:32 +08:00
tanzhenxin
fed08cb1dd fix(config): remove enableToolOutputTruncation setting
Remove the enableToolOutputTruncation boolean setting. Users can now
disable truncation by setting truncateToolOutputThreshold to 0 or a
negative value instead of using a separate toggle.

This simplifies the configuration and prevents users from accidentally
disabling truncation which could cause memory issues with large tool
outputs.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-15 11:30:02 +08:00
tanzhenxin
ba1680564e fix(session): handle cancellation during prompt queue wait
- Install AbortController before awaiting previous prompt so session/cancel
  during the wait targets the correct prompt
- Check if cancelled after waiting for previous prompt to complete
- Drop untagged streamEnd events when a tagged stream is active

This prevents race conditions where a new prompt could be incorrectly
cancelled or have its state cleared by stale events from a previous prompt.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-14 17:47:12 +08:00
tanzhenxin
2d4310ee9b fix(vscode): scope streamEnd to specific request invocation
Add `forRequestId` parameter to `sendStreamEnd()` to detect and ignore
stale calls when a newer request has taken over shared state.

This prevents stale handleSendMessage invocations from emitting
streamEnd events tagged with the wrong request ID.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-14 17:13:20 +08:00
tanzhenxin
b3560e47a7 fix(vscode): prevent race conditions in prompt cancellation and streaming
- Add pendingPromptCompletion tracking to ensure new prompts wait for
  previous prompt's tool results before reading chat history
- Add requestId correlation between streamStart/streamEnd to detect and
  discard stale events from cancelled requests
- Guard against duplicate streamEnd messages
- Preserve isWaitingForResponse during cancel to prevent auto-submit

This fixes malformed history issues in VS Code extension where rapid
prompt cancellation and resubmission caused tool_call → user_query →
tool_result ordering instead of the correct sequence.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-14 16:13:19 +08:00
tanzhenxin
eff6543d05 Merge branch 'main' into feature/arena-agent-collaboration 2026-03-13 21:16:49 +08:00
顾盼
d950ad0f7d
Merge pull request #2344 from QwenLM/fix-vscode-encoding
Refactors `FileSystemService` interface to use ACP-aligned request/response objects
2026-03-13 18:05:33 +08:00
LaZzyMan
f9de25d7c5 fix review bugs 2026-03-13 17:45:39 +08:00