Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): show readable messages for structured thread errors #9950

Closedjuliusmarmingewants to merge 2 commits intomain fromfix/audit-thread-error-headlineopened View on GitHub

juliusmarmingecommented

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.

  • At the same 366px text width, the 166-character payload becomes its complete 83-character message in two lines. The 245-character payload becomes its complete 115-character message in three lines.
  • The tooltip retains the exact original 166/245 characters without horizontal overflow. The wide-view control and native dismiss interaction pass.
  • All 30 focused banner tests pass, including both public payloads, whitespace preservation, unchanged fallbacks, one-pass extraction and raw-payload dismissal identity. Fallback shapes were verified in unit tests, not separately in the browser. No new static-markup assertions were added.
  • Focused lint, web typecheck and diff checks pass after merging current main. CI and configured reviews are tracked on the current PR head.

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.

Before: raw JSON occupies the thread error banner

After

The same error shows its message at the same viewport and thread position.

After: the full nested message appears in the thread error banner

The existing tooltip still exposes the complete original diagnostic.

After: the tooltip preserves the exact original JSON payload

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 getThreadErrorBannerMessage helper parses JSON when possible and shows a non-empty error.message string 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](https://cursor.com/bugbot) for commit 05a247c51fd26318a4fd697b357301853fb1af48. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Extract nested error.message from JSON payloads in ThreadErrorBanner headline

  • Adds getThreadErrorBannerMessage utility that parses a JSON error string and returns the nested error.message when it is a non-empty string; all other inputs fall back to the original error string without recursive unwrapping
  • ThreadErrorBanner now shows the extracted message as the alert headline while the tooltip keeps the full original error string
  • Adds test coverage for single-line and multiline JSON, malformed payloads, missing fields, and dismissal-key isolation for diagnostics with the same nested message but different codes
Macroscope summarized 05a247c.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.6 KiB13.6 KiB−14 B (−0.1%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB+3 B (+0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.6 KiB6.6 KiB−17 B (−0.3%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.1 KiB57.1 KiB0 B (0.0%)66.4 KiB✅
      CodexLive turn messages10100 (0.0%)21✅
      ClaudeTotal thread wire13.6 KiB13.6 KiB+21 B (+0.2%)15.1 KiB✅
      ClaudeThread snapshot wire7.0 KiB7.0 KiB−5 B (−0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.5 KiB6.6 KiB+26 B (+0.4%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded57.9 KiB57.9 KiB0 B (0.0%)66.4 KiB✅
      ClaudeLive turn messages10100 (0.0%)21✅

      Baseline: 2fa5ef4 · PR result: 05a247c · Source CI: success

      Scenario and decoded snapshot size

      10 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.

      • Codex decoded thread snapshot: 113.8 KiB
      • Claude decoded thread snapshot: 114.5 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 05a247c

      Macroscope's review found this PR approvable — This is a self-contained web UI fix that replaces raw structured error JSON with its readable nested message while preserving the full payload and existing dismissal behavior. The added tests cover recognized and fallback formats, keeping the runtime impact narrow and low risk.

      Notes:

      • Diff unchanged. Approvability was decided on eligibility alone.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. 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.

    5. juliusmarminge added labelsmacroscope-review

    6. juliusmarminge assignedjuliusmarminge

    7. Taking over this one for composer-chat-07. Main now uses an expandable error display rather than the original tooltip, so I will rebuild the focused message extraction on current main in a replacement stack, preserving full diagnostics and raw-payload dismissal identity. The existing human presentation-approval hold remains; nothing will be merged.

    8. Thanks for the focused message-extraction work. I rebuilt this as #21483, crediting juliusmarminge, because main replaced the tooltip with an expandable error display while this PR was open.

      I compared the complete original diff with the replacement. The conservative one-level extraction, exact fallback strings, whitespace preservation, raw diagnostic availability, and raw-payload dismissal identity are all retained. The obsolete tooltip integration is replaced with the existing inline disclosure, including short diagnostics; the exhaustive JSON matrix is reduced to focused behavior tests plus a real Chromium expand/collapse test. Nothing from the intended presentation behavior was dropped. The dedicated ChatGPT usage-limit panel remains intact.

      The replacement has matching actual-app before/after screenshots and an interaction recording, and one parallel Opus/Sol review round found no code blockers. CI is following its current head. The HUMAN-HOLD presentation decision carries over unchanged, and #3747 remains open. Closing this original as superseded; neither PR is merged.

    9. juliusmarminge closed this

Sign in to join this conversation.