Add a .catch() handler to the promise before advancing timers to prevent
Node.js from reporting an unhandled rejection when maxAttempts is exhausted
during the TPM throttling retry test.
- Changed default value from false to true in settingsSchema.ts
- This aligns the schema with the actual code behavior (?? true fallback)
- Matches documentation and test expectations
- Resolves inconsistency reported in issue #1764Fixes#1764
- Add abort listener cleanup in Query.close() to prevent memory leak
- Add abort listener cleanup in ControlDispatcher.shutdown()
- Remove AbortController recreation in Session.handleInterrupt()
This fixes the MaxListenersExceededWarning that occurred when:
- Creating 11+ Query instances in SDK/non-interactive mode
- Multiple user interrupts (Ctrl+C) in interactive mode
- Intensive control request scenarios
- Move TPM throttling check before shouldRetryOnError to ensure TPM errors
without standard HTTP status codes are still retried
- Add comprehensive unit tests for edge cases:
- TPM error without status property
- Nested TPM error object without top-level status
- Consecutive TPM throttling errors
- Max attempts exhaustion for TPM errors
- Remove redundant error checking logic in isTPMThrottlingError function
- Reuse isStructuredError and isApiError utilities from quotaErrorDetection module
- Clean up duplicate import statements
Add support for detecting and handling TPM (Tokens Per Minute) throttling errors.
When a TPM throttling error is detected (e.g., 'Throttling: TPM(10680324/10000000)'),
the system now waits 1 minute before retrying instead of using exponential backoff.
Changes:
- Add isTPMThrottlingError() function to detect TPM throttling errors
- Modify retryWithBackoff() to use fixed 1-minute delay for TPM errors
- Add unit tests for TPM throttling detection and retry behavior
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Add a "Dev Launch CLI" VS Code debug configuration and fix
scripts/dev.js to preserve existing NODE_OPTIONS (e.g. --inspect
flags injected by VS Code debugger) instead of overwriting them.
The ModelSelector's keydown handler used bubble-phase addEventListener
on document, so pressing Enter to confirm a model would also propagate
to the InputForm and trigger a form submit with empty text — creating
a ghost user-message bubble.
Fix: register the handler with `{ capture: true }` and call both
`preventDefault()` and `stopPropagation()` on arrow/Enter/Escape
keys so the event never reaches the InputForm.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Reorder source type detection: check local path existence first, then Git URLs, then owner/repo format
- Remove 'marketplace' as a separate type; use originSource='Claude' instead to identify Claude marketplace extensions
- Simplify type system from 5 types (git/local/link/github-release/marketplace) to 4 types
- Fix issue where relative paths (../path, ./path) were incorrectly treated as owner/repo format
- Add comprehensive test coverage for all path detection scenarios
When session/set_model fails with an authentication error (expired
token, invalid credentials, etc.), the extension now:
- Shows a VSCode error notification with the model name for context
- Sends a loginRequired message to the webview so it renders the
Onboarding login page (without clearing chat history)
- On successful re-login the forceLogin overlay is dismissed
Also guards against empty/zero-width-space-only chat messages and
strips the internal ACP `\nData: {...}` payload from user-facing
error messages.
Includes unit tests for SessionMessageHandler (setModel success,
auth errors, generic errors, missing modelId, stripAcpErrorData)
and useWebViewMessages (loginRequired/loginSuccess round-trip).
Co-authored-by: Cursor <cursoragent@cursor.com>