Commit graph

3801 commits

Author SHA1 Message Date
LaZzyMan
109b3d41ab fix: reduce redundant file I/O and fix BOM preservation for non-UTF-8 encodings
- Extract isUtf8CompatibleEncoding to iconvHelper.ts, removing duplicate
  definitions in fileUtils.ts and fileSystemService.ts
- Add readFileWithEncodingInfo() returning content + encoding + bom in a
  single I/O pass; update edit.ts and write-file.ts to use it instead of
  separate readTextFile/detectFileEncoding/detectFileBOM calls
- Add readTextFileWithInfo() to FileSystemService interface; implement in
  StandardFileSystemService and AcpFileSystemService (delegates to fallback)
- Fix FileReadResult.bom to be true for all Unicode BOM variants (UTF-8/
  16/32), not just UTF-8; add getBOMBytesForEncoding() and update
  writeTextFile to re-prepend the correct BOM bytes on write-back so
  UTF-16/32 BOM files are no longer silently corrupted
- Add tests for readFileWithEncodingInfo, readTextFileWithInfo, and
  UTF-16LE BOM write-back preservation
2026-03-04 16:03:17 +08:00
zy6p
b3142afaaa fix(cli): parse markdown frontmatter with CRLF and BOM 2026-03-04 16:03:14 +08:00
lgzzzz
2819c7d887 feat: add tabWidth support for code highlighting and replace tabs with spaces in CodeColorizer
(cherry picked from commit 2849f907f68022ed2879216a764668878a0bb282)
2026-03-04 15:45:49 +08:00
DennisYu07
f0cc28f80f implementation SessionStart and SessionEnd hook 2026-03-03 23:39:57 -08:00
LaZzyMan
a5eb1733fa fix: preserve original encoding when reading/writing non-UTF-8 files
Fixes #2069

- Add iconv-lite dependency for non-UTF-8 encoding support
- Add iconvHelper.ts as a CJS/ESM compatibility wrapper
- Update readFileWithEncoding() to detect and handle GBK/Big5/Shift_JIS
  using BOM detection -> UTF-8 validation -> chardet -> iconv-lite fallback
- Add detectFileEncoding() to identify file encoding before writes
- Update writeTextFile() to accept encoding option and encode with iconv-lite
- Update WriteFileTool and EditTool to detect and preserve original encoding
- Add tests for GBK read/write, detectFileEncoding, and encoding option
2026-03-04 14:52:46 +08:00
Drew Duncan
e2ca264874 Merge main to get modalityDefaults support 2026-03-03 20:30:50 -08:00
tanzhenxin
0c8251fd7f Merge branch 'main' into feature/arena-agent-collaboration 2026-03-03 21:34:16 +08:00
yiliang114
f774f14c79 fix(ide): correct HTTP connection order and lock file matching logic
- Always try localhost first in HTTP connection, then fallback to
  host.docker.internal when in container environment
- Return undefined when scanned lock files do not match current workspace
  instead of returning the first config

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 21:14:47 +08:00
tanzhenxin
9d8921db5f
Merge pull request #2060 from QwenLM/fix/dashscope-subdomain-url-pattern
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(dashscope): support subdomain URL patterns for DashScope provider detection
2026-03-03 20:47:20 +08:00
tanzhenxin
dd45fa7c9c fix(logging): pass responseId to _logApiError instead of undefined
Updated _logApiError calls to pass the actual responseId from the response
object rather than undefined. This improves error logging by including the
response identifier for better traceability.

Also updated other _logApiError calls to use empty string as fallback for
type consistency.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 18:37:21 +08:00
tanzhenxin
fc793d6545 fix(dashscope): support subdomain URL patterns for DashScope provider detection
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 18:23:29 +08:00
mingholy.lmh
b8eccc4a4f Fix failing tests in @packages/cli/src/gemini.test.tsx
- Add missing config methods: getUsageStatisticsEnabled, getSessionId, getOutputFormat
- Fix stdin TTY setting for stream-json mode to ensure correct code path execution
- Fix duplicate key definition issue

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 17:37:16 +08:00
mingholy.lmh
33d65af79b fix(acp): add session/set_config_option method for mode and model configuration
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 17:16:01 +08:00
yiliang114
755f3264c8 fix(test): correct FileHandle type in mock implementation
Add FileHandle type import and fix the mock function parameter type
to match fs.promises.readFile signature (PathLike | FileHandle).
2026-03-03 17:00:12 +08:00
yiliang114
748f235e2c fix(ide): add fallback host and lock directory scan for Docker environments
- Retry HTTP connection with 127.0.0.1 when host.docker.internal fails
- Scan IDE lock directory when env var and legacy config are unavailable
- Handle code-server scenario where extension runs inside container

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 16:26:06 +08:00
DennisYu07
7cde98e238 move enable/disable to hooksConfig 2026-03-02 23:57:12 -08:00
yiliang114
da059c804e refactor(ide): remove cloud IDE environment detection and simplify connection logic
- Remove isCloudIdeRuntime, getCloudIdeEnvironmentLabels functions
- Remove DEVCONTAINER detection in detect-ide
- Simplify ideCommand by removing cloud IDE special handling
- Refactor getIdeServerHost to use dns.promises.lookup
- Use single promise cache for IDE server host resolution

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 14:50:50 +08:00
LaZzyMan
b7ba1b9336 fix ci test 2026-03-03 14:32:22 +08:00
LaZzyMan
8c62435a9a fix: handle symlinks during extension installation
When installing extensions from GitHub repos containing symlinks (e.g.
symlinks pointing to directories), the copy operation fails with
ENOTSUP: operation not supported on socket, copyfile.

Root cause: git clone without core.symlinks=true creates text files
instead of real symlinks on some platforms, and fs.promises.cp cannot
copy these entries properly.

Fix applied at two layers:
1. git clone: add -c core.symlinks=true to preserve symlinks
2. copyExtension: add dereference:true to follow symlinks and copy
   actual content, with a filter to skip non-regular files
3. gemini-converter copyDirectory: resolve symlinks via realpathSync
   and copy target content
4. claude-converter collectResources: skip non-regular files

Fixes #2050
2026-03-03 14:09:45 +08:00
yiliang114
bed4419cb5 Merge branch 'main' into fix/docker-ide-host-check 2026-03-03 13:19:29 +08:00
yiliang114
5222ebc96c chore(deps):update the peer dependency configuration in the package-lock.json 2026-03-03 13:19:23 +08:00
DennisYu07
423cc85265 remove useless type 2026-03-02 19:30:24 -08:00
易良
f027fdf621
Merge branch 'main' into feat/add-vscode-settings-json-schema 2026-03-03 11:21:57 +08:00
DennisYu07
7b0929d00c add integration test and --experimental-hooks 2026-03-02 19:05:28 -08:00
tanzhenxin
b749e80325 chore: fix build errors 2026-03-02 23:30:19 +08:00
tanzhenxin
1a718b7cf5 fix(core): Handle Windows EPERM errors and cross-platform paths in arena
Add retry logic with exponential backoff for file renames that fail with
EPERM/EACCES on Windows during concurrent operations. Fix test to use
path.join() for cross-platform compatibility.

This improves reliability of arena agent collaboration on Windows.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 23:20:18 +08:00
tanzhenxin
0c5deee263 feat(arena): Add comprehensive telemetry for arena sessions
- Add arena_session_started, arena_agent_completed, arena_session_ended events
- Implement ArenaManager telemetry hooks with lifecycle tracking and metrics
- Update AgentStatistics to support API-provided totalTokenCount and remove estimatedCost
- Pass agent session IDs for telemetry correlation in PTY mode

This enables detailed observability into arena performance, agent
completion rates, and model comparison outcomes.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 23:12:33 +08:00
tanzhenxin
407a66c959
Merge pull request #2005 from zhangxy-zju/feat/strengthen-output-language-template
Some checks are pending
Qwen Code CI / CodeQL (push) Waiting to run
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
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
feat(i18n): strengthen output-language.md template to enforce language compliance
2026-03-02 23:07:18 +08:00
tanzhenxin
a119adb6bd Merge branch 'main' into feature/arena-agent-collaboration 2026-03-02 22:24:38 +08:00
DennisYu07
e4e21bb6b7 resolve comment 2026-03-02 06:11:11 -08:00
tanzhenxin
1a6bd0b573
Merge pull request #2030 from QwenLM/feat/improve-auth-dialog-ux
feat(cli): improve auth dialog UX with clearer three-option layout
2026-03-02 22:07:58 +08:00
tanzhenxin
2a7a74c9d4 feat(auth): update coding plan description to reflect all available models
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 21:51:47 +08:00
Mingholy
7679910f26 fix(cli): ignore stream-json input format in TTY mode to prevent hanging
- Force TEXT input format in TTY mode instead of allowing stream-json
  which would cause the process to hang when runNonInteractiveStreamJson
  is called without proper stdin data.
- Always initialize app regardless of input format to ensure proper setup.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 21:23:59 +08:00
tanzhenxin
fa5bd26b68 fix(auth): validate Coding Plan API key prefix for China region
- Add validation to check API key starts with "sk-sp-" for China region
- Add Chinese translation for the validation error message
- Only apply prefix validation when region is aliyun.com (China)

This prevents users from submitting invalid API keys for the China region, providing immediate feedback with a localized error message.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 21:19:41 +08:00
xieyonn
6867b43be3
feat(cli): change temporary filename prefix to qwen-edit- 2026-03-02 20:01:07 +08:00
DennisYu07
74e1bf17d6 remove conflict experimental 2026-03-02 03:50:37 -08:00
tanzhenxin
112318d092 Merge branch 'main' into feat/improve-auth-dialog-ux 2026-03-02 19:16:45 +08:00
tanzhenxin
f59328aada Merge branch 'main' into pr-2021 2026-03-02 19:07:11 +08:00
tanzhenxin
5deba24d05
Merge pull request #1999 from QwenLM/split/tool-scheduler-refactor
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:none (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
refactor(core): extract single tool-call execution path
2026-03-02 18:56:06 +08:00
yiliang114
15e8c0e26c Merge branch 'main' into fix/docker-ide-host-check 2026-03-02 18:10:14 +08:00
易良
c353fbbfa3
feat(cli): add Ctrl+Y shortcut to retry failed requests (#2011)
* feat: add Ctrl+Y shortcut to retry failed requests

- Add Ctrl+Y keyboard shortcut for retrying the last failed request
- Add isNetworkError() to detect transient network failures (ECONNREFUSED, ETIMEDOUT, etc.)
- Add DashScope 1305 error code to rate limit detection
- Add error hint \"Press Ctrl+Y to retry\" in error messages
- Support user-defined error codes for retry via config
- Add retryLastPrompt() hook in useGeminiStream
- Update keyboard shortcuts documentation

* feat: improve Ctrl+Y retry feature with tests, docs, and rate limit config

- Add comprehensive tests for Ctrl+Y retry shortcut in InputPrompt
- Add unit tests for retryLastPrompt in useGeminiStream hook
- Add detailed JSDoc comments for retryLastPrompt function and Ctrl+Y shortcut
- Extend isRateLimitError to support custom error codes via retryErrorCodes config
- Fix rate limit retry log variable reference (RATE_LIMIT_RETRY_OPTIONS → maxRateLimitRetries)
- Add Eclipse IDE files to .gitignore

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

* refactor(ui): consolidate retry countdown as inline hint in error messages

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

* feat(cli): enhance error handling with improved retry mechanism

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

- Modify ErrorMessage component to remove dim color from hint text

- Update useGeminiStream hook to improve retry countdown behavior with option to preserve or clear hints

- Adjust tests to match new error handling implementation

* feat: add Ctrl+Y shortcut to retry the last failed request

When a request errors out, the error message shows an inline hint
"(Press Ctrl+Y to retry.)" in secondary color. Pressing Ctrl+Y
re-submits the same prompt, commits the error text to history
(without the hint), and clears the hint from the UI.

- Add retryLastPrompt action wired to Ctrl+Y via keyBindings and InputPrompt
- Track last submitted prompt and error state in useGeminiStream refs
- Show retry hint inline with error text in ErrorMessage component,
  wrapping naturally on narrow terminals while preserving hint color
- Expose retryLastPrompt through UIActionsContext
- Add keyboard shortcut entry in KeyboardShortcuts display
- Add i18n strings for hint and no-retry-available message
- Document Ctrl+Y in keyboard-shortcuts.md

* docs(configuration): Update model provider configuration document

* chore: remove YOLO mode code from core

* fix: prevent Ctrl+Y hint from overriding auto-retry countdown

When an auto-retry countdown is active (retryCountdownTimerRef is set),
handleErrorEvent should not overwrite it with the Ctrl+Y hint. The auto-retry
hint ("retrying in Xs...") and manual retry hint ("Press Ctrl+Y to retry.")
are mutually exclusive:

- Auto-retry errors (e.g., rate limits): show countdown hint
- Other errors: show Ctrl+Y hint

Also removed retryErrorCodes from ContentGeneratorConfig as it's not part
of the minimal Ctrl+Y feature scope.

* simplify: remove complex options from clearRetryCountdown

Revert clearRetryCountdown to simplest form without options parameter.
The function now just clears the timer and pending item without any
automatic history commit logic.

* fix: restore pendingRetryCountdownItem as separate state from pendingRetryErrorItem

Auto-retry countdown and manual retry hint are now independent:
- pendingRetryErrorItem: displays error message with optional hint
- pendingRetryCountdownItem: displays separate countdown line for auto-retry

This ensures both can be shown simultaneously without overriding each other.

* fix: restore RetryCountdownMessage rendering in HistoryItemDisplay

The retry_countdown type should be rendered as a separate message,
not inline in ErrorMessage. This allows auto-retry countdown and
manual retry hint to coexist properly.

* fix(cli): properly commit retry error item to history before clearing

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

* fix(cli): remove trailing period from retry hint translations

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

Remove unnecessary period from 'Press Ctrl+Y to retry' translation strings in both en.js and zh.js locales. Also update the corresponding usage in useGeminiStream hook.

* chore(sdk-java): add Eclipse project configuration files

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

Add .project configuration files for client and qwencode modules to support Eclipse IDE development environment.

* feat(cli): add retry countdown hint to error message

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

* Revert "chore(sdk-java): add Eclipse project configuration files"

This reverts commit da83b5e571.

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 17:59:18 +08:00
tanzhenxin
6fdd715458
Merge pull request #2017 from QwenLM/mingholy/fix/acp-config-options
Fix ACP protocol compatibility issues with Zed editor
2026-03-02 17:51:38 +08:00
tanzhenxin
6a617f5248
Merge pull request #1982 from QwenLM/fix/modality-defaults-pdf-error
fix: add modality defaults to prevent API errors when reading PDFs and other media
2026-03-02 17:42:17 +08:00
tanzhenxin
f6376d2e0b
Merge pull request #2041 from QwenLM/fix/reduce-streaming-log-output
fix(logging): reduce excessive streaming output in session history logs
2026-03-02 17:41:25 +08:00
tanzhenxin
076efa6ee8
Merge pull request #1995 from QwenLM/fix/idealtalk-api-inner
fix(core/rateLimit): add support for rate limit error code 1305 and custom retry error codes
2026-03-02 17:22:46 +08:00
mingholy.lmh
43d728e8cc fix: revert removed schema fileds 2026-03-02 17:22:20 +08:00
mingholy.lmh
9c426a7961 fix(acp): fix session/list and remove fork capability
- Make cwd optional in listSessionsRequestSchema (defaults to process.cwd())
- Remove fork from sessionCapabilities (not supported)

Fixes -32602 error when Zed calls session/list without cwd param.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 17:22:19 +08:00
mingholy.lmh
a08bc1bbf3 fix(acp): add sessionCapabilities to initialize response
Add sessionCapabilities with fork, list, and resume capabilities
to initialize response to match Claude Agent's format.

This enables Zed ACP client to discover session management features.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 17:22:19 +08:00
mingholy.lmh
c7c2ae217b fix(acp): align session/list response format with Claude Agent
Update session/list response to match Claude Agent's format:
- Change 'items' to 'sessions' array
- Add 'title' field (mapped from prompt)
- Add 'updatedAt' field (ISO format from mtime)
- Remove 'hasMore' and 'nextCursor' fields

This fixes session list display in Zed ACP client.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 17:22:18 +08:00
mingholy.lmh
e5bdd5b635 fix(acp): add modes and configOptions to session/new response
Add missing 'modes' and 'configOptions' fields to NewSessionResponse
to enable mode switching (plan/yolo/auto-edit) in Zed ACP client.

- Update schema.ts: add configOptionSchema and extend newSessionResponseSchema
- Update acpAgent.ts: add buildModesData() and buildConfigOptions() helpers

Fixes ACP mode control issue where Zed couldn't switch approval modes.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-02 17:22:18 +08:00