Commit graph

4493 commits

Author SHA1 Message Date
Shaojin Wen
cf7204118f fix(core): avoid corrupting JSON strings in SSE whitespace normalization
Replace broad \s+} and \s+] regexes with a narrower pattern that only
strips whitespace before closing braces/brackets when preceded by a
JSON value terminator (", digit, ] or }). Prevents mangling string
values like "hello   }" which contain whitespace before braces.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 17:46:54 +08:00
Shaojin Wen
1b651d5c4f refactor(cli): make /btw non-blocking with fire-and-forget API call
Run the /btw API call as fire-and-forget in interactive mode so the
main conversation is not blocked while waiting for the answer. The
action now returns immediately after setting the pending item, and
the background promise updates the UI when the answer arrives.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 17:41:28 +08:00
Shaojin Wen
b1b5f72507 fix(cli): revert tools:[] to empty config for provider compatibility
Revert tools:[] to empty config {} to avoid provider compatibility
issues. Empty tools array is truthy and gets passed through to API
requests, which can cause errors on some providers. Omitting the
tools field entirely achieves the same effect (no tool access).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 17:24:57 +08:00
高铁
a9c2866ca8 fix(core): define Anthropic stream types locally to fix verbatimModuleSyntax incompatibility
The @anthropic-ai/sdk package's type exports are not compatible with
TypeScript's verbatimModuleSyntax option when using NodeNext module
resolution. Define the stream event types locally to avoid the import error.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-14 17:09:57 +08:00
Shaojin Wen
ed9a4edc40 fix(cli): add model guard and explicit tools:[] for /btw command
Explicitly pass tools:[] to generateContent to prevent tool invocation
in side questions. Add model undefined guard for defensive safety.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 16:44:13 +08:00
Shaojin Wen
d285c4409a fix(cli): extract duplicate error formatting and add tests for /btw command
Extract repeated error formatting into formatBtwError helper, remove
no-op marginTop={0}, and add comprehensive test coverage for all three
execution modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 16:20:21 +08:00
Shaojin Wen
fda065314f refactor(cli): simplify /btw by passing geminiClient directly to askBtw
Remove redundant null check by passing the already-validated client and
model to the helper function instead of re-extracting them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 16:04:10 +08:00
Shaojin Wen
8b90b145b3 fix(cli): address audit issues in /btw command
- Add ACP mode support with stream_messages async generator
- Add non-interactive mode support with simple message return
- Add wrap="wrap" to Text components for long text handling
- Extract askBtw helper to reduce duplication across execution modes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 15:56:39 +08:00
Shaojin Wen
8dc34c385d fix(cli): address review issues in /btw command
- Add pendingItem conflict guard to prevent overwriting other operations
- Use finally block to ensure setPendingItem(null) is always called
- Wrap "Thinking..." with t() for i18n support
- Remove unnecessary type assertion, use typed variable instead

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 15:53:14 +08:00
Shaojin Wen
3818f8acd4 feat(cli): add /btw slash command for ephemeral side questions
Allow users to ask quick "by the way" questions that use the current
conversation context but don't pollute the main conversation history.

Closes #2370

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 15:50:41 +08:00
Shaojin Wen
1359563f45
feat(skills): add bundled /review skill for out-of-the-box code review (#2348)
feat(skills): add bundled /review skill for out-of-the-box code review
2026-03-14 15:15:08 +08:00
tanzhenxin
f1ee4638b7
Merge pull request #2355 from QwenLM/fix/remove-debug-log-session-setup
fix(cli): remove unused debug log session setup in loadSettings
2026-03-13 20:21:29 +08:00
tanzhenxin
fe9819836c fix(cli): remove unused debug log session setup in loadSettings
The temporary debug log session setup at the start of loadSettings() was
removed along with unused imports (setDebugLogSession, sanitizeCwd). The
resolvedWorkspaceDir variable is now defined where it's actually used.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 20:05:23 +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
tanzhenxin
f3cd92946c
Merge pull request #2351 from QwenLM/release/v0.12.3
chore(release): bump version to 0.12.3
2026-03-13 17:47:02 +08:00
LaZzyMan
f9de25d7c5 fix review bugs 2026-03-13 17:45:39 +08:00
tanzhenxin
278add5147
Merge pull request #2265 from wenshao/fix/remove-duplicate-exports-index
fix(core): remove duplicate exports in packages/core/src/index.ts
2026-03-13 17:34:33 +08:00
tanzhenxin
cb1f8d7691
Merge pull request #2350 from QwenLM/fix/ctrl-f-pty-artifact
fix(cli): prevent Ctrl+F from leaking to PTY as ^F artifact
2026-03-13 17:32:18 +08:00
tanzhenxin
d195c95b9c
Merge pull request #2245 from yshngg/bugfix/mcp-add-option
fix: improve qwen mcp add option handling for arrays
2026-03-13 17:30:49 +08:00
tanzhenxin
affddfe021 docs(shell): clarify enableInteractiveShell default behavior
Document that the setting defaults to true on most platforms but false
on Windows builds <= 19041 due to ConPTY reliability issues, matching
VS Code's approach.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 17:16:47 +08:00
tanzhenxin
aa206112ee
Merge pull request #2349 from QwenLM/fix/windows-conpty-default
fix(core): disable node-pty on older Windows builds with broken ConPTY
2026-03-13 16:47:36 +08:00
tanzhenxin
04beebe587
Merge pull request #2347 from QwenLM/fix/windows-shell-args-quoting
fix(shell): pass args as string on Windows to prevent quoting issues
2026-03-13 16:47:18 +08:00
tanzhenxin
d2ea1b9d3f
Merge pull request #2345 from QwenLM/fix/gpt5-token-limits
fix(core): correct GPT-5.x input token limit to 272K
2026-03-13 16:46:55 +08:00
tanzhenxin
f2b7d9aaac chore(release): bump version to 0.12.3
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 16:42:12 +08:00
tanzhenxin
f831586d96 fix(cli): prevent Ctrl+F from leaking to PTY as ^F artifact
When toggling shell focus mode with Ctrl+F, the raw control character
was being forwarded to the PTY, causing a ^F artifact to appear in the
shell. This fix intercepts the Ctrl+F keypress before it reaches the
PTY when it's used for focus mode toggling.

Fixes #2236

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 16:34:55 +08:00
tanzhenxin
4e5fccf82e test(cli): remove flaky keyboard interaction tests on Windows
Remove tests that rely on arrow key and keyboard input timing which are
unreliable on Windows CI due to terminal emulation differences.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 16:13:31 +08:00
tanzhenxin
6383b41975 fix(core): disable node-pty on older Windows builds with broken ConPTY
ConPTY on Windows builds <= 19041 has known reliability issues including
missing output and hangs. VS Code uses the same cutoff.

This fixes run_shell_command returning empty output on affected Windows
systems by falling back to spawn-based execution instead of node-pty.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 16:06:27 +08:00
tanzhenxin
452ee89a9f fix(shell): set windowsVerbatimArguments only for cmd.exe
- Enable windowsVerbatimArguments only when shell is cmd.exe
- PowerShell requires default escaping for correct arg round-trip

The windowsVerbatimArguments option skips Node's MSVC CRT escaping,
which cmd.exe doesn't understand. PowerShell (.NET) needs the default
escaping so args pass correctly through CommandLineToArgvW.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 15:50:21 +08:00
tanzhenxin
e1dfb4a844 fix(shell): only use string args for cmd.exe on Windows
PowerShell handles array args correctly via CommandLineToArgvW, and
the string form breaks quoted paths ending in backslash (e.g.,
"C:\Temp\") because \" is treated as an escaped quote.

This refines the previous fix to only apply the workaround to cmd.exe.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 15:21:10 +08:00
tanzhenxin
6193aade55 fix(shell): pass args as string on Windows to prevent quoting issues
On Windows, node-pty's argsToCommandLine re-quotes array elements that
contain spaces, which mangles user-provided quoted arguments. For example,
'type "hello world"' becomes '"type \"hello world\""'.

By passing args as a single string instead of an array on Windows,
node-pty concatenates it verbatim, preserving the original quoting.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 14:53:25 +08:00
tanzhenxin
2f4f44d213 test(core): update GLM output limit tests to match 128K
Updates test expectations for GLM-5 and GLM-4.7 output limits
from 16K to 128K to align with the implementation changes.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 14:45:20 +08:00
tanzhenxin
613e8b3633 fix(core): correct GPT-5.x input token limit to 272K
GPT-5.x models have 400K total context but 128K is reserved for output,
so the actual input limit is 272K (400K - 128K). Also updates GLM-5 and
GLM-4.7 output limits from 16K to 128K.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-13 14:26:12 +08:00
LaZzyMan
5e58e29bde Merge branch 'main' into fix-vscode-encoding 2026-03-13 13:50:30 +08:00
LaZzyMan
328862aee7 fix encoding in acp 2026-03-13 13:47:25 +08:00
tanzhenxin
625c50aae7
Merge pull request #2322 from QwenLM/fix/ide-connection-dns-lookup
Some checks failed
Qwen Code CI / Lint (push) Has been cancelled
Qwen Code CI / CodeQL (push) Has been cancelled
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Has been cancelled
E2E Tests / E2E Test (Linux) - sandbox:none (push) Has been cancelled
E2E Tests / E2E Test - macOS (push) Has been cancelled
Qwen Code CI / Test (push) Has been cancelled
Qwen Code CI / Test-1 (push) Has been cancelled
Qwen Code CI / Test-2 (push) Has been cancelled
Qwen Code CI / Test-3 (push) Has been cancelled
Qwen Code CI / Test-4 (push) Has been cancelled
Qwen Code CI / Test-5 (push) Has been cancelled
Qwen Code CI / Test-6 (push) Has been cancelled
Qwen Code CI / Test-7 (push) Has been cancelled
Qwen Code CI / Test-8 (push) Has been cancelled
Qwen Code CI / Post Coverage Comment (push) Has been cancelled
fix(ide): resolve IDE connection issues in some VSCode clients and optimize connection config lookup
2026-03-13 11:34:50 +08:00
顾盼
46d57afb22
Merge pull request #2327 from QwenLM/fix-mcp-auth
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
feat(mcp): improve OAuth auth UX - post-auth feedback, i18n, clear auth, and bug fixes
2026-03-13 00:32:58 +08:00
LaZzyMan
31914a451e feat(mcp): show 'Re-authenticate' for servers with existing OAuth tokens
Servers that already have stored OAuth tokens now display 'Re-authenticate'
instead of 'Authenticate' in the server detail actions, making it clearer
that credentials already exist. Added i18n for all 6 languages.
2026-03-12 22:08:17 +08:00
易良
bbcd131f0d
Merge pull request #2326 from QwenLM/fix/error-message-in-cli
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / CodeQL (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
fix: clear retry error messages promptly after auto-retry succeeds
2026-03-12 21:22:19 +08:00
LaZzyMan
ec0db29bef fix(mcp): prevent EADDRINUSE when re-entering OAuth authentication
Track the active OAuth callback server at module level. When a new
authentication is started, close any previously running callback server
first to avoid 'listen EADDRINUSE: address already in use :::7777'
errors that occur when the user navigates back and re-enters auth.
2026-03-12 21:02:09 +08:00
LaZzyMan
dcf986838c feat(mcp): improve OAuth auth UX - post-auth feedback, i18n, clear auth, and bug fixes
- Show tool count and completion message after successful authentication
- Auto-navigate back to server details after auth success (2s delay)
- Add structured i18n messages for OAuth display (core emits key/params, CLI translates)
- Add 'Clear Authentication' option for servers with stored OAuth tokens
- Fix: clearing auth now disconnects server (not just deleting tokens)
- Fix: auth popup infinite loop caused by onSuccess triggering reload/remount cycle
- Add ToolRegistry.disconnectServer() (disconnect without adding to exclusion list)
- Add i18n translations for all 6 languages (en/zh/de/ja/pt/ru)
2026-03-12 20:46:59 +08:00
yiliang114
d951e30cfa fix: clear retry error messages promptly after auto-retry succeeds
Previously, when an auto-retry countdown elapsed and the server sent a
Retry event (without retryInfo) to signal the actual retry attempt, the
error message was not cleared because `pendingRetryCountdownItemRef` was
still set. This caused stale error messages to persist in the UI until
the user manually initiated a new request.

Additionally, when the user pressed Ctrl+Y to retry, the error was
committed to history (without hint) instead of being discarded. This was
inconsistent with the auto-retry behavior where errors are silently
cleared on success.

Changes:
- Always call clearRetryCountdown() when a Retry event without retryInfo
  is received, removing the flawed guard condition
- Remove error-to-history commit in retryLastPrompt for consistent UX
- Add test covering the countdown-elapsed retry scenario

Closes #2310

Made-with: Cursor
2026-03-12 20:43:29 +08:00
顾盼
d77fe134cb
Merge pull request #2324 from QwenLM/feat/ls-tool-truncation
feat(core): add truncation support to LS tool
2026-03-12 20:26:36 +08:00
tanzhenxin
097f1b3da9 feat(core): add truncation support to LS tool
Add output truncation for directory listings when entries exceed
configured line limit. This prevents overwhelming output for large
directories while still informing users of truncated content.

- Add MAX_ENTRY_COUNT constant (100) as upper bound
- Use getTruncateToolOutputLines() config for dynamic limits
- Show truncated item count with proper singular/plural handling
- Update output format with --- separators for clarity
- Add comprehensive tests for truncation behavior

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-12 19:59:59 +08:00
yiliang114
fc81fb285a Merge branch 'main' of https://github.com/QwenLM/qwen-code into fix/ide-connection-dns-lookup 2026-03-12 19:19:42 +08:00
tanzhenxin
e181cfc097
Merge pull request #2315 from xuewenjie123/fix/remove-qrcode-from-oauth-progress-v2
fix: remove QR code from OAuth authentication UI to prevent screen flickering
2026-03-12 18:53:25 +08:00
Mingholy
1d87675534
Merge pull request #2298 from QwenLM/mingholy/fix/vscode-acp-error
fix: improve ACP file operation error handling
2026-03-12 17:53:23 +08:00
顾盼
2ff9305b19
Merge pull request #2320 from QwenLM/fix/deepseek-array-content
fix(core): convert array content to string for DeepSeek API
2026-03-12 17:50:03 +08:00
tanzhenxin
182422ce2b
Merge pull request #2307 from QwenLM/release/v0.12.2
chore: Release v0.12.2
2026-03-12 17:45:40 +08:00
易良
4e04b0937a
Merge pull request #2308 from ossaidqadri/fix/completion-tab-key-support
fix(webui): add Tab key support to CompletionMenu
2026-03-12 17:39:24 +08:00
tanzhenxin
1da0c2bf30 refactor(ui): remove spinner from OAuth progress component
This simplifies the OAuth progress UI by removing the animated spinner,
resulting in a cleaner, more maintainable component.

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