- Add cachedContentTokenCount tracking in uiTelemetry service
- Collect cached_content_token_count from streaming usage metadata
- Use cached tokens instead of estimated overhead when available
- Fix messages token calculation to avoid 'messages = 0' issue
This improves context window display accuracy when using providers
that support prefix caching (e.g., DashScope).
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add helper functions for better code organization (createPrintableKey,
getCompleteCsiSequenceLength, parsePlainTextPrefix)
- Drop unsupported Kitty CSI-u keys without blocking subsequent input
- Recover plain text that arrives in same chunk after unsupported CSI-u keys
- Add comprehensive tests for edge cases (CAPS_LOCK, event metadata variants)
Improves robustness of Kitty keyboard protocol parsing by gracefully
handling unsupported key codes and ensuring plain text input is not lost.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Increase description warning threshold from 500 to 1,000 characters
- Change system prompt 10,000 char limit from error to warning
- Remove intermediate 5,000 char warning threshold for system prompts
- Update documentation to reflect soft warning behavior
This provides more flexibility for users while still guiding them
toward better practices.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Extract truncateAndSaveToFile to utils/truncation.ts with tests
- Move truncation handling from CoreToolScheduler to ShellTool
- Remove outputFile field from ToolCallResponseInfo and display types
- Add line limit constraint alongside character threshold for truncation
This improves separation of concerns by handling output truncation at the tool level where the output is generated, rather than centrally in the scheduler.
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>
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>
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.
- 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
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>
- Update Header.test.tsx to expect single border (┌┐) instead of round (╭╯)
- Update QwenOAuthProgress.test.tsx:
- Change cancel text expectation from '(Press ESC or CTRL+C to cancel)' to 'Esc to cancel'
- Update loading state test to expect 'Qwen OAuth Authentication' title
- Simplify animated dots test to avoid timing sensitivity
- Rename 'gray border' test to 'single border' test
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Replace round border with single border style for consistency
- Use semantic-colors theme instead of Colors enum
- Add i18n translations for error messages and status text
- Simplify dots animation with fixed-width cycling patterns
- Consolidate into single bordered box layout
- Add Esc to cancel hint for better UX
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Remove the 'navigates between tabs with left/right arrows' test from
AskUserQuestionDialog.test.tsx due to timing-related flakiness.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Remove the terminal QR code display from the OAuth authentication progress
component. The QR code caused severe screen flickering on Windows PowerShell
due to Ink's full re-render cycle combined with the large character volume
of the QR code and high-frequency state updates (spinner + countdown timer).
The authorization URL link is preserved for users to complete authentication.
Changes:
- Remove qrcode-terminal import and QrCodeDisplay component
- Replace with simplified AuthUrlDisplay component (URL only)
- Remove qrCodeData state and QR code generation useEffect
- Remove unused createDebugLogger import and debugLogger instance
The /export commands (html, md, json, jsonl) were incorrectly using
loadLastSession() which loads the last modified session from disk,
rather than the currently active session.
This fix uses config.getSessionId() to get the current session ID
and loads the correct session with loadSession(sessionId).
Fixes#2267
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
The tests used fixed wait times (200ms) that were too close to the
auto-advance timeout (150ms). In CI environments (especially Windows
with Node 20), timing can be less predictable due to event loop
scheduling differences, causing race conditions.
Changes:
- Increased wait(200) to wait(300) for auto-advance tests
- Increased wait() to wait(100) for navigation tests in custom input state test
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>