Skip to content

fix(cli): renderer header redraw produces mid-string char drops + U+FFFD (distinct from #655 Symptom A) #662

Closed

Description

@admarble

Summary

A separate corruption class from #655's complete[0:8] + failed[9:] byte-math overlay (Symptom A). Captured in the #647 AC-1 production replay (docs/incidents/647/captures/2026-05-17/terminal.typescript).

The renderer's repeated SEQUANT WORKFLOW · #N · Xs elapsed header line — written once per second by the 1Hz redraw — intermittently lands in scrollback with characters elided mid-string or replaced by U+FFFD (�). Pattern is non-deterministic across the 2,181 header lines in the capture but consistent in shape.

Evidence

From docs/incidents/647/captures/2026-05-17/terminal.typescript, sampled across the 36m run:

SEQUANT WORKFLOW · #658 ·  31s elapsed       # "28m" elided from cols ~25-27
SEQUANT WORKFLOW · 8 · 29m 19s elapsed       # "#65" elided
SEQUANT WORW · #658 · 35m 7s elapsed         # "KFLO" elided mid-WORKFLOW
SEQUANT WORKFLW · #658 · 34m 43s elapsed     # "O" elided
SEQUANT WORKFLOW · #658 · 32m 41s eled       # "aps" elided from "elapsed"
SEQUANT WORKFLOW · #658 · 33m 5s eed         # "elaps" elided
SEQUANT WORKFLOW · #65 34m 19s elapsed       # "8 ·" elided
SEQUANT WORKFLOW �#658 · 28m 55s elapsed     # U+FFFD where "·" should be
SEQUANT WORKFLOW · #658 · 31m 50s elapUANT WORKFLOW · #658 · 31m 55s elapsed   # two header lines smashed together

Differences from #655 Symptom A

#655 Symptom A This issue (Symptom 2)
Byte math complete[0:8] + failed[col 9+] overlay Single-char or short-run mid-string drops; U+FFFD substitution
Source events Two distinct event-line writes (complete then failed) Single event-line write that lands corrupted
Glyph ✔ (from complete) followed by error text (from failed) The string itself loses bytes
Reproduction Not in the #647 AC-1 capture Confirmed reproducing in the #647 AC-1 capture

Likely shared root cause with #647 Mechanism #1

Both symptoms share the property "renderer output corrupted under the redraw + scrollback regime." Plausible mechanisms:

  • UTF-8 byte truncation at non-codepoint boundaries when log-update's eraseLines runs against a partially-flushed prior frame.
  • Terminal-emulator-side rendering glitch when the 1Hz redraw races with the OS-level pty buffer flushing.
  • Stderr co-writer interleaving (the AC-1 instrumentation writes to stderr; under script(1) both streams merge, creating opportunities for races — though the corruption was already present in pre-instrumentation transcripts).

Discriminating these requires a capture without script(1) wrapping, so the stderr stream can be isolated. See docs/incidents/647/captures/2026-05-17/notes.md "Caveat — script wrapper interference".

Acceptance criteria

Out of scope

Related

Activity

  1. added
    bug
    cli
    ui
    on May 17, 2026
  2. admarble commented on May 17, 2026

    @admarble
    ContributorAuthor

    Bundling with #647 — both Mechanism #1 (duplicate headers in scrollback) and Symptom 2 (mid-string char drops + U+FFFD on header redraws) appear in the same docs/incidents/647/captures/2026-05-17/terminal.typescript capture and most likely share a single root cause (renderer redraw race + log-update scrollback erasure semantics under continuous 1Hz repaint).

    If AC-3 of #647 lands and Symptom 2 persists, this can be reopened with the post-fix capture as evidence.

  3. added a commit that references this issue on May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcliui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions