Skip to content

Improve DeepSeek request failure handling#104

Merged
Vizards merged 5 commits into
mainfrom
fix/deepseek-error-actions
May 25, 2026
Merged

Improve DeepSeek request failure handling#104
Vizards merged 5 commits into
mainfrom
fix/deepseek-error-actions

Conversation

@Vizards
Copy link
Copy Markdown
Owner

@Vizards Vizards commented May 25, 2026

Summary

  • surface HTTP and network failures with user-facing DeepSeek error messages instead of generic fetch failures
  • add provider-aware error action links through VS Code URI callbacks
  • split the client and runtime activation code into focused modules

Validation

  • npm run format:check && npm run compile && npm run lint

Copilot AI review requested due to automatic review settings May 25, 2026 19:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 keep src/extension.ts as 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.

Comment thread src/runtime/commands.ts Outdated
Comment thread src/client/error.ts Outdated
Comment thread src/client/error.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread src/runtime/commands.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Comment thread src/client/error.ts
Comment thread src/client/error.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread .vscode/settings.json
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 catch path, the method calls callbacks.onError(normalizedError) but does not rethrow/reject afterwards. That means errors can be silently swallowed if an onError implementation doesn’t throw (the StreamCallbacks contract returns void). Consider rethrowing normalizedError after invoking the callback (while still allowing a callback-thrown error to propagate) so callers can reliably observe failures via the returned Promise.

Comment thread src/runtime/actions.ts Outdated
Comment thread src/runtime/provider.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Comment thread src/runtime/lifecycle.ts
Comment thread src/runtime/provider.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

@Vizards Vizards merged commit 788b1d7 into main May 25, 2026
2 checks passed
@Vizards Vizards deleted the fix/deepseek-error-actions branch May 25, 2026 21:46
@Vizards Vizards linked an issue May 26, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants