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>
* 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>
* 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>
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
- 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
- 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
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
* 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>
- 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.
- 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>
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.
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>
- 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>
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>
- 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>