fix(web): show readable messages for structured thread errors - #9950
fix(web): show readable messages for structured thread errors#9950juliusmarminge wants to merge 2 commits into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, self-contained web UI fix that replaces raw structured error JSON with its readable nested message while preserving the original payload in the tooltip and dismissal behavior. Tests cover the extraction and fallback cases, with no schema, configuration, security, billing, or deployment impact. You can add or adjust custom eligibility rules. Learn more. |
|
Preparation is complete at 05a247c5, against 2fa5ef4c. All executed CI checks pass, including Bugbot, correctness, UI consistency and automated approvability. Skipped checks remain skipped. The complete current-head review snapshot has no unresolved threads or change requests. The 30 focused tests, lint, web typecheck and approved before/after evidence are recorded above. HUMAN-HOLD remains. Automated eligibility does not decide whether diagnostic fields should move from the headline into the existing tooltip. This PR stays unmerged for that presentation decision, and #3747 stays open with its native-platform and mobile limits. No server normalization or layout behavior changed. GPT 6 Astra via Codex in T3 Code. |
Related to #3747. Keep that issue open.
The chat error banner still displays raw JSON even when the response contains a useful
error.message. Show that nonempty string in the headline, while retaining the exact original payload in the existing tooltip. Plain text, invalid JSON and unrecognized shapes keep their current display. Dismissal keys still use the raw payload, so different diagnostics with the same headline remain distinct.HUMAN-HOLD: this is a proposed presentation choice. Diagnostic fields move out of the collapsed headline into the existing tooltip. Keep this PR unmerged pending human approval. It changes only the shared web/desktop banner, not mobile error details, server normalization, transport contracts, layout or word wrapping. It does not address the underlying provider errors.
Earlier message-extraction work was proposed by xxashxx-svg in #3830, which closed when orchestration V2 replaced its server paths. This narrower implementation leaves that broader normalization out. The original tiny-width layout defect did not reproduce on current main and was already addressed by #3899; the remaining raw-JSON headline did reproduce.
Verification
Both exact public JSON examples were rendered in an isolated Linux Chromium 152 client using a disposable thread. No provider or account request was made. Main 7a089b2b displayed the raw payloads. The exact candidate banner patch was then tested on 2fa5ef4c, whose intervening changes did not touch the banner.
The original Arch/Qtile Electron and macOS desktop environments were not available. Mobile is unchanged. These limits are why this PR does not close the whole report.
Before
The multiline public payload appears as JSON in the clamped headline.
After
The same error shows its message at the same viewport and thread position.
The existing tooltip still exposes the complete original diagnostic.
GPT 6 Astra via Codex in T3 Code.
Note
Low Risk
Presentation-only change in the web chat error banner with conservative parsing fallbacks and no changes to dismissal or transport behavior.
Overview
Structured API error payloads no longer fill the thread error banner headline with raw JSON. A new
getThreadErrorBannerMessagehelper parses JSON when possible and shows a non-emptyerror.messagestring in the clamped headline; plain text, invalid JSON, and unrecognized shapes are unchanged.The tooltip still shows the full original error string, so diagnostics stay available without cluttering the visible line. Dismissal keys remain tied to the raw payload, so two errors with the same extracted headline (e.g. same message, different
code) stay independently dismissable—covered by a new test.Reviewed by Cursor Bugbot for commit 05a247c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Extract nested
error.messagefrom JSON payloads inThreadErrorBannerheadlinegetThreadErrorBannerMessageutility that parses a JSON error string and returns the nestederror.messagewhen it is a non-empty string; all other inputs fall back to the original error string without recursive unwrappingThreadErrorBannernow shows the extracted message as the alert headline while the tooltip keeps the full original error stringMacroscope summarized 05a247c.