Conversation
β¦work diagnostics When a fetch error occurs (e.g. TypeError: Failed to fetch), the error body now includes provider, model, apiMode, fetchOnClient, elapsedMs, networkStatus, and traceId to help diagnose issues instead of only showing a useless minified stack. Fixes LOBE-6594 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@ONLY-yours - This PR enriches fetch error context in the chat service and agent executors (fetch-sse streaming error handling). Please take a look. |
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## canary #13468 +/- ##
========================================
Coverage 66.48% 66.48%
========================================
Files 1972 1972
Lines 160137 160150 +13
Branches 16047 15341 -706
========================================
+ Hits 106467 106482 +15
+ Misses 53550 53548 -2
Partials 120 120
Flags with carried forward coverage won't be shown. Click here to find out more.
π New features to boost your workflow:
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7359d85326
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| errorMessage: error.message, | ||
| errorName: error.name, |
There was a problem hiding this comment.
Preserve legacy unknown-error body keys for compatibility
The unknown-error branch now writes body.errorMessage/body.errorName instead of the established body.message/body.name fields, which is a breaking shape change for existing handlers that read body.message (and is already inconsistent with the current fetchSSE test expectations). This causes downstream error renderers/extractors to lose the primary message unless they are updated in lockstep; keep backward-compatible keys when enriching diagnostics.
Useful? React with πΒ / π.
|
β€οΈ Great PR @arvinxx β€οΈ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
Summary
provider,model,apiMode,fetchOnClient,elapsedMs,networkStatus, andtraceIdfor better debuggingTypeError: Failed to fetcherrors only showed a useless minified stack trace with no actionable informationFixes LOBE-6594
Changes
packages/fetch-sse/src/fetchSSE.tsFetchSSERequestContextinterface; record fetch start time; enrich error body with request context,elapsedMs, andnetworkStatussrc/services/chat/index.tsrequestContext(provider, model, apiMode, fetchOnClient) tofetchSSEsrc/store/chat/agents/createAgentExecutors.tstraceIdto error body inonErrorHandleError body before vs after
Before:
{ "name": "TypeError", "message": "Failed to fetch", "stack": "TypeError: Failed to fetch\n at create2 (app://renderer/assets/index-DRIaUz_L.js:599009:33)..." }After:
{ "provider": "openai", "model": "gpt-4o", "apiMode": "chatCompletion", "fetchOnClient": false, "elapsedMs": 45, "networkStatus": true, "traceId": "xxx-yyy-zzz", "errorName": "TypeError", "errorMessage": "Failed to fetch" }Test plan
bun run type-checkβ no new type errors in changed filesπ€ Generated with Claude Code