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