Improve DeepSeek request failure handling#104
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves how the extension surfaces DeepSeek request failures (HTTP + network), adds provider-aware “action links” via VS Code URI callbacks, and refactors activation/runtime code into smaller focused modules.
Changes:
- Introduce a structured DeepSeek client error model (HTTP/network/unknown) with localized, user-facing summaries and richer diagnostics.
- Add URI-handler-backed action links (e.g., set API key, show logs) and activate the extension on URI open.
- Split extension activation into
src/runtime/*modules and keepsrc/extension.tsas a thin entrypoint.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/runtime/welcome.ts | Extracts “show welcome walkthrough if needed” logic into runtime module. |
| src/runtime/provider.ts | Centralizes provider construction + command registration + Copilot Chat activation. |
| src/runtime/lifecycle.ts | New activate/deactivate lifecycle wrapper with guarded activation + welcome flow. |
| src/runtime/index.ts | Barrel export for runtime lifecycle. |
| src/runtime/diagnostics.ts | Extracted activation diagnostics + debugMode change logging. |
| src/runtime/commands.ts | Registers extension commands (logs, request dumps, API key page, settings). |
| src/runtime/actions.ts | Registers URI handler and resolves provider action URLs for error messages. |
| src/provider/stream.ts | Wraps streamed request errors into user-facing DeepSeek error messages. |
| src/i18n.ts | Adds localized strings for HTTP/network error summaries and action labels. |
| src/extension.ts | Simplifies entrypoint to re-export runtime activate/deactivate. |
| src/consts.ts | Adds constants for handled URI paths (show logs / set API key). |
| src/client/types.ts | Adds shared client error/action-link types. |
| src/client/index.ts | Exposes client + error helpers via a public barrel. |
| src/client/error.ts | Implements DeepSeekRequestError, normalization, user-facing markdown formatting, and action selection. |
| src/client/core.ts | Updates client to throw structured HTTP errors and normalize/log network failures. |
| src/client/consts.ts | Adds provider link definitions and a curated network-error code categorization table. |
| package.json | Adds onUri activation to support URI action links even before startup activation. |
| .vscode/settings.json | Updates workspace TypeScript SDK setting key. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/client/core.ts:176
- In the
catchpath, the method callscallbacks.onError(normalizedError)but does not rethrow/reject afterwards. That means errors can be silently swallowed if anonErrorimplementation doesn’t throw (theStreamCallbackscontract returnsvoid). Consider rethrowingnormalizedErrorafter invoking the callback (while still allowing a callback-thrown error to propagate) so callers can reliably observe failures via the returned Promise.
This was
linked to
issues
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation