Skip to content

fix(client): improve request failure diagnostics#109

Open
Vizards wants to merge 1 commit into
mainfrom
fix/request-failure-diagnostics
Open

fix(client): improve request failure diagnostics#109
Vizards wants to merge 1 commit into
mainfrom
fix/request-failure-diagnostics

Conversation

@Vizards
Copy link
Copy Markdown
Owner

@Vizards Vizards commented May 27, 2026

Summary

  • Add request context to DeepSeek HTTP and network failure diagnostics, including base URL, model, request shape, and response details.
  • Keep Output logs readable by using a compact first-line diagnostic summary with the raw stack below it.
  • Preserve nested network cause details as a single-line JSON payload without dumping the whole error object as formatted output.

Validation

  • npm run compile
  • npm run format:check
  • npm run lint
  • git diff --check

Copilot AI review requested due to automatic review settings May 27, 2026 08:34
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 DeepSeek client failure diagnostics by attaching request context (base URL + request shape metadata) to HTTP/network errors and emitting a compact, readable first-line summary with the raw stack beneath it.

Changes:

  • Introduces a RequestErrorContext type to carry base URL + request details into error handling.
  • Enhances HTTP and network error diagnostic strings to include request metadata (model, stream, tool/message counts, etc.) and safer single-line serialization.
  • Updates client logging to emit a single formatted diagnostic+stack string via formatRequestError.

Reviewed changes

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

File Description
src/client/types.ts Adds RequestErrorContext to pass request/baseUrl context into error formatting.
src/client/error.ts Extends diagnostic formatting for HTTP/network/unknown errors and adds formatRequestError.
src/client/core.ts Passes request context into error creation/normalization and updates logging to use the new formatter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants