Commit graph

3801 commits

Author SHA1 Message Date
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
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
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
palanisd
9665760f43
fix(insight): handle individual LLM failures in qualitative insights (#2341) (#2361)
Previously, `generateQualitativeInsights` used `Promise.all` with a
`generate` helper that re-threw errors. A single LLM call failure
(timeout, rate limit, JSON parse error) caused the entire `qualitative`
object to become `undefined`, hiding all detailed report sections.

Now individual `generate` calls catch errors and return `undefined`
instead of throwing. The `QualitativeInsights` interface fields are
made optional so partial results render correctly — each React section
component already guards against missing data with `if (!field) return
null`.

Made-with: Cursor
2026-03-14 15:39:46 +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
88685e55f6 fix(core): strip orphaned user entries before retry to prevent API errors
Replace isContinuation boolean with SendMessageType enum for clearer
message type semantics. Add stripOrphanedUserEntriesFromHistory() to
clean up orphaned user entries in chat history before retry operations,
preventing 'messages with role tool must be a response to preceding
message with tool_calls' API errors.

Fixes #2360

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-14 12:51:34 +08:00
netbrah
b416bbdcc6 fix(core): guard against empty choices in convertOpenAIResponseToGemini
The streaming path (convertOpenAIChunkToGemini) already uses optional
chaining on choices and guards with `if (choice)`, but the
non-streaming path accesses choices[0] directly. Providers that return
an empty choices array cause a TypeError crash.

Made-with: Cursor
2026-03-13 13:20:23 -04:00
netbrah
4990a56f74 fix(core): add deepseek-r1 to output token limit patterns
deepseek-r1 normalizes to `deepseek-r1` which does not match the
existing `^deepseek-reasoner` output pattern, causing it to fall
through to the 8K default. DeepSeek R1 supports 64K output tokens,
same as deepseek-reasoner. Without this fix, responses from
deepseek-r1 are silently truncated at 8K tokens.

Made-with: Cursor
2026-03-13 13:16:40 -04:00
DennisYu07
368c45d7bf adapt claude to qwen code 2026-03-13 07:28:23 -07:00
tanzhenxin
eff6543d05 Merge branch 'main' into feature/arena-agent-collaboration 2026-03-13 21:16:49 +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
LaZzyMan
c01a309cda fix core tool config 2026-03-13 17:58:34 +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
DennisYu07
f11758c6bc add extension for hooks 2026-03-13 02:32:09 -07: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
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
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
DennisYu07
9b91479356 fix test failure 2026-03-12 18:48:56 -07:00
chen893
94005ee948 chore: update i18n locale files 2026-03-13 01:33:48 +08:00
chen893
3671600e2a fix(i18n): improve de and pt locale quality 2026-03-13 00:51:55 +08:00
chen893
da27dc0cb3 fix(i18n): add missing slash command locale keys 2026-03-13 00:46:12 +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
chen893
cc120712c1 fix(i18n): localize slash command descriptions 2026-03-13 00:16:31 +08:00
DennisYu07
aa0f04b60a add doc for hooks and skip integration test 2026-03-12 07:44:26 -07: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
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