Skip to content

[Bug]: Grok TUI on orca serve — PTY stuck tiny (8×20) / blank / garbled (not scroll/brand) #10706

Closed as not planned

Description

@LesleyMurfin

Summary

On a multi-agent orca serve host, Grok full-screen TUI panes frequently become unusable because of wrong/stale PTY geometry and/or bad repaint, not because of mouse-wheel / brand detection.

Symptoms we hit in production (any/all):

  1. Viewport is tiny — TUI draws into a postage-stamp grid (we have live sessions at 8×20).
  2. Nothing useful displays — pane looks blank / dead while the Grok process is still running.
  3. Characters are garbled — overlapping, scrambled, or unreadable layout when something does paint.

This is not #10613 (Grok mouse wheel / TERM_PROGRAM=Orca → Unknown brand). We already mitigated that path with a host TERM_PROGRAM=vscode shim; size/garble still happens.

Environment (measured on the runtime host)

Item Value
Orca 1.4.155 (ORCA_APP_VERSION=1.4.155, AppImage orca-linux-1.4.155)
Mode orca serve headless Linux, typical port 6768
Serve binary packaged orca-ide … serve --port 6768 --json (pairing address redacted)
Host Ubuntu 24.04.4, Linux 6.8.0-124-generic x86_64
Grok 0.2.112 (9bbd559437) [stable]
Concurrent Grok agents ~24 live PTYs at capture time
Client path Paired desktop/web clients against this serve host (not local-only AppImage)

Live process env (healthy-looking Grok pane)

TERM=xterm-256color
TERM_PROGRAM=vscode                 # host stopgap for brand/scroll (#10613 / #10469 class)
TERM_PROGRAM_VERSION=1.4.155
ORCA_REAL_TERM_PROGRAM=Orca
ORCA_REAL_TERM_PROGRAM_VERSION=1.4.155
ORCA_APP_VERSION=1.4.155
COLORTERM=truecolor
ORCA_TERMINAL_HANDLE=term_…
ORCA_PANE_KEY=… 
ORCA_TAB_ID=…

So brand advertising is already forced to the VS Code / xterm.js profile. The failures below are geometry / render, not “Unknown brand.”

Hard evidence: mixed PTY sizes on the same host (same serve, same Grok build)

TIOCGWINSZ / stty -F /dev/pts/N size across live Grok processes at capture:

PTY size (rows×cols) Live Grok count Notes
69×162 13 Looks like a full desktop pane
40×120 7 Mid size (mobile? smaller client? stale?)
8×20 3 Unusable for any full-screen TUI

Example tiny sessions:

pid=2505083  /dev/pts/44  8×20  grok --permission-mode bypassPermissions
pid=2892713  /dev/pts/24  8×20  grok …
pid=2898860  /dev/pts/49  8×20  grok --permission-mode bypassPermissions

While siblings on the same host are healthy at 69×162. That is not “Grok wants a small UI” — it is PTY size not tracking the visible pane / getting stuck after reveal or client handoff.

An 8×20 grid matches the failure mode described in open PR #7961 (stale post-reveal resize leaving sessions at tiny/80×24-class sizes until a manual resize).

Expected

  • Every Grok agent PTY’s rows/cols match the active client’s visible pane.
  • After tab switch, focus change, reconnect, or multi-client attach, size reconverges (no permanent 8×20 / 40×120 stuck sessions).
  • When the buffer is healthy, the canvas repaints cleanly (no garbled glyphs requiring manual resize).

Actual

  • Multiple concurrent Grok sessions on one serve host end up at wildly different PTY sizes, including 8×20.
  • Operators see tiny UI, blank panes, or garbled / overlapping characters.
  • Session process often still alive; problem is display/geometry, not process death.
  • Manual window/pane resize (when possible from the client) is the usual recovery — same recovery class as #7951 / #7240.

Reproduction (fleet / serve)

  1. Run orca serve 1.4.155 on Linux (headless), pair a desktop client.
  2. Spawn many Grok agent terminals (worktrees / orchestration / long-lived sessions). We routinely run 20+.
  3. Switch tabs, reconnect clients, leave sessions backgrounded, open from multiple client viewports over time.
  4. On the serve host, measure:
# for each live grok:
stty -F /dev/pts/N size
# or TIOCGWINSZ via the process controlling tty
  1. Observe a mix of full-size and tiny (e.g. 8×20) PTYs while Grok is still running.

Intermittent from the UI, but objective on the host via winsize.

Recovery checklist (operator experience)

  • Slight window/pane resize often restores usable layout
  • Ctrl+L / app redraw — sometimes helps garble; does not fix a stuck 8×20 PTY
  • Tab away/back — can trigger both garble and stale size
  • Select/drag text — sometimes clears garble only
  • Restart Grok in-pane — only helps if spawn gets a correct size
  • Host-side: tiny PTYs remain tiny until something re-issues a real resize

Why not #10613

#10613 (brand/scroll) This report
/doctor terminal brand Unknown under TERM_PROGRAM=Orca We force TERM_PROGRAM=vscode; ORCA_REAL_TERM_PROGRAM=Orca
Wheel / scrollback Dead Not the complaint
PTY size N/A 8×20 / 40×120 / 69×162 mixed on one host
Visual Scroll doesn’t move Tiny / blank / garbled TUI

Related (closest existing work)

Size / stuck small grid

  • #7951 — Terminal UI breakage on switching (resize fixes)
  • #7961 — avoid stale PTY resize after tab reveal (explicit tiny/80×24 stale reassert) ← strongest match for 8×20
  • #7209 — SSH/remote size ≠ local pane
  • #7006 — visible terminal size convergence (blank / wrong wrap when geometry disagrees)
  • #8396 (closed) — headless/orca serve full-screen TUI width constrained despite wide PTY

Garbled / repaint / WebGL

  • #7240 — garbled after tab-switch reveal
  • #9115 — garbled after window focus
  • #10133 — garbled agent TUI (Windows)
  • #6071 — WebGL glyph atlas recovery
  • #5031 (closed) — WebGL atlas corruption on agent spinners

Not this issue

Ask

  1. Treat this as PTY size convergence + reveal/repaint (likely [Bug] Terminal UI breakage on switching #7951 / fix(terminal): avoid stale PTY resize after tab reveal #7961), not Grok product logic.
  2. Please land fix(terminal): avoid stale PTY resize after tab reveal #7961 (or equivalent) in a 1.4.x serve build we can run — we can re-run the host winsize audit immediately after upgrade.
  3. Longer term: serve should reject / re-fit absurd sizes (e.g. < ~20×40) for full-screen agent TUIs and reassert against the active client viewport.
  4. If you want a minimal CI gate: multi-pane reveal with a forced mid-flight size change must never leave a live agent at 8×20.

Labels suggestion

bug, terminal, os:linux, orca-remote-server, has_repro (winsize audit on host is conclusive for the tiny-PTY half)

Activity

  1. LesleyMurfin commented on Jul 26, 2026

    @LesleyMurfin
    ContributorAuthor

    Host evidence dump (2026-07-26T07:15–07:16 UTC)

    Collected live on the runtime host while the fleet was in the broken state. This is not client-side speculation — it's kernel PTY winsize + process env.

    Snapshot summary

    Metric Value
    Host Ubuntu 24.04.4 (6.8.0-124-generic x86_64)
    Orca 1.4.155 serve (serve-root-1.4.155, AppImage releaseDate 2026-07-24)
    Serve orca-ide … serve --port 6768 --json under a dedicated service user
    Grok 0.2.112 (9bbd559437) [stable]
    Live Grok PTYs audited 23
    Size histogram 12× 69×162, 8× 40×120, 3× 8×20
    Load ~12 loadavg, 251 Gi RAM, serve up ~19h since upgrade

    Kernel winsize proof (tiny sessions exist)

    stty -F / TIOCGWINSZ samples:

    ===== tiny  pid=2505083 tty=/dev/pts/44 =====
    speed 38400 baud; rows 8; columns 20; line = 0;
    # raw modes show Grok TUI active (-icanon -echo, etc.)
    
    ===== mid   pid=133047  tty=/dev/pts/62 =====
    rows 40; columns 120
    
    ===== large pid=60133   tty=/dev/pts/61 =====
    rows 69; columns 162
    

    All three size classes share the same brand env (so this is not #10613):

    TERM=xterm-256color
    TERM_PROGRAM=vscode                 # host stopgap already applied
    TERM_PROGRAM_VERSION=1.4.155
    ORCA_REAL_TERM_PROGRAM=Orca
    ORCA_REAL_TERM_PROGRAM_VERSION=1.4.155
    ORCA_APP_VERSION=1.4.155
    COLORTERM=truecolor
    COLUMNS=   (unset)
    LINES=     (unset)
    DISPLAY=:99                         # headless Xvfb-class display
    

    xpixel/ypixel are 0 on all sampled PTYs (no pixel geometry).

    Full size table (live)

    size pid tty ORCA_TERMINAL_HANDLE worktree/cwd (redacted)
    8×20 2505083 pts/44 term_f25aff4f-d006-4fe3-be13-8754ff5e2a17 …/project-a/worktree-x
    8×20 2892713 pts/24 term_747e3451-9398-4030-88e0-b2465be53e60 …/project-a/worktree-x
    8×20 2898860 pts/49 term_02bb248b-f04e-4ad9-9e3e-b9c0432b1da5 …/project-a/worktree-x
    40×120 133047 pts/62 term_164b3773-5a01-4486-9976-a45019821fb7 …/project-b/automation-run-…
    40×120 2495270 pts/41 term_57c224c1-fb58-4303-b356-5cfff16d68b6 …/project-c/worktree-y
    40×120 2495526 pts/42 term_9ec72424-b3ab-46a7-a98c-823f78b23539 …/project-c/worktree-y
    40×120 2495773 pts/43 term_874caddc-7f05-4a98-859e-63388ae93242 …/project-c/worktree-y
    40×120 2505988 pts/47 term_0bf33233-7cb7-4029-b8d2-2ed2a96840ac …/project-d/worktree-z
    40×120 (+3 more automation runs)
    69×162 60133 pts/61 term_c4f1c372-99ea-4dcd-81f4-72622e104ca9 …/project-b (main)
    69×162 (+11 more) various project worktrees

    Clustering note: all three 8×20 Grok sessions were under the same worktree, with distinct terminal handles — so this is not one shared PTY; three separate agent panes stuck tiny.

    Parent chain for tinies (example):

    daemon → bash --rcfile …/shell-ready/bash/rcfile → grok --permission-mode bypassPermissions
    

    Serve main process started 2026-07-25 12:07 UTC (1.4.155). Tiny sessions started ~04:14–04:55 UTC 2026-07-26 (hours after serve start), so this is not only cold-boot 0×0.

    Daemon log

    daemon.log (~352 KB) only shows session-created / session-killed / session-exited JSON — no resize/winsize events logged (so we cannot correlate from daemon alone; winsize is the ground truth).

    Session create for one tiny-related worktree (paths shortened):

    {"src":"daemon","ts":"2026-07-26T04:14:25.013Z","event":"session-created",
     "sessionId":"…/worktree-x@@5ff198df"}
    {"src":"daemon","ts":"2026-07-26T04:54:58.343Z","event":"session-created",
     "sessionId":"…/worktree-x@@01c25ab5"}
    {"src":"daemon","ts":"2026-07-26T04:55:30.356Z","event":"session-created",
     "sessionId":"…/worktree-x@@d2d4ea91"}

    main.trace.ndjson

    Scanned current + recent rotated traces (~42k spans in window). Content is almost entirely git.exec effect-spans — no terminal resize / cols / rows / handle strings for these sessions. Tracing does not currently surface PTY geometry (gap for debugging this class).

    Why this points at #7961 / size convergence

    1. Same host, same serve, same Grok binary → mixed 8×20 / 40×120 / 69×162.
    2. Brand env already VS Code-shaped → not scroll/brand ([Bug]: Grok mouse wheel / scrollback dead in Orca (TERM_PROGRAM=Orca → Unknown brand) #10613).
    3. 8×20 is exactly the “stuck after reveal / wrong client viewport / 0×0 settle” class described in fix(terminal): avoid stale PTY resize after tab reveal #7961 (stale PTY reassert leaving tiny grids).
    4. Mid-size 40×120 cluster looks like a second client viewport (mobile / smaller desktop pane / stale attach) never re-arbitrated to the large client.

    Reproduction audit command (for maintainers / after fix)

    On the serve host:

    # histogram of live Grok PTY sizes
    python3 - <<'PY'
    import os, fcntl, struct, termios, subprocess
    from collections import Counter
    c=Counter()
    for pid in map(int, subprocess.check_output(["pgrep","-f",r"grok"]).split()):
        try:
            tty=os.readlink(f"/proc/{pid}/fd/0")
            if not tty.startswith("/dev/pts"): continue
            fd=os.open(tty, os.O_RDONLY|os.O_NOCTTY)
            try:
                r,cols,_,_=struct.unpack("HHHH", fcntl.ioctl(fd, termios.TIOCGWINSZ, b"\0"*8))
            finally: os.close(fd)
            c[f"{r}x{cols}"] += 1
        except Exception: pass
    print(dict(c))
    PY

    Pass criteria after a fix build: zero sessions with rows < 20 or cols < 40 while a desktop client is attached; ideally all interactive agent panes converge to the active client viewport within a few hundred ms of reveal.

    Artifacts

    Evidence gist (redacted): https://gist.github.com/LesleyMurfin/30ba2938574e6f291d69b5c1da19ff31

    Related: #7951 #7961 #7209 #7006 #7240 #9115 #6071 — still not #10613.

  2. LesleyMurfin commented on Jul 26, 2026

    @LesleyMurfin
    ContributorAuthor

    Evidence gist (redacted bundle)

    Full host dump for the snapshot above:

    https://gist.github.com/LesleyMurfin/30ba2938574e6f291d69b5c1da19ff31

    Files:

    • all-grok-pty-sizes.txt / all-grok-pty-sizes.json — complete audit of 23 live Grok PTYs (pid, tty, rows×cols, handles, env)
    • size-table.md — sorted markdown table including all three 8×20 handles
    • stty-a-samples.txt — raw stty -a for 8×20 / 40×120 / 69×162
    • env subset + one full redacted env for a tiny session
    • 00-versions.txt, package/AppImage meta for 1.4.155
    • daemon-log-hits.txt — session lifecycle only (no resize telemetry)
    • trees-and-tiny.txt — parent chains for stuck-tiny Grok processes
    • host-load.txt

    Note: ORCA_AGENT_HOOK_TOKEN and similar secrets were redacted from env dumps. Terminal handles left intact for correlation.

  3. LesleyMurfin commented on Jul 26, 2026

    @LesleyMurfin
    ContributorAuthor

    Client console: exact match for open headless-serve regression

    Paired web client against this host’s headless orca serve 1.4.155 logs:

    [web-runtime-session] failed to create terminal: No renderer window available
        at createWebRuntimeSessionTerminalResult (web-runtime-session-….js:451)
    

    That string is thrown server-side when a focused terminal/agent create is routed through getAuthoritativeWindow() and the serve process has no BrowserWindow (true headless / xvfb-only serve).

    Open tracking (this error text)

    Item Status Notes
    #10553 Open Headless serve: agent create from desktop client fails with 'No renderer window available' since ~v1.4.153 — both sides on 1.4.155; same message. Root cause: terminal.createAgentSession with presentation: 'focused' on windowless serve.
    #10333 Open Mac UI + / terminal create --focus → same error on headless remote
    #9047 Open Web client vs headless serve (related host/ownership / local PTY path)
    #10557 Open PR degrade focused terminal create on headless serve — fix for #10553
    #10370 Open PR headless terminal create --focus without renderer window — fix for #10333
    #10192 / #10193 Closed Earlier fix for same class; regressed after createAgentSession / ~1.4.153

    How this relates to #10706 (tiny / blank / garbled)

    Two failure modes can stack on the same headless serve:

    1. Hard fail: focused create → No renderer window available. Matches Headless serve: agent create from desktop client fails with 'No renderer window available' since ~v1.4.153 #10553 / unmerged fix(runtime): degrade focused terminal create on headless serve #10557.
    2. Soft fail (PTY geometry): create does spawn (often background path) but winsize sticks at 8×20 / 40×120 while siblings are 69×162 (host audit in prior comments). Matches [Bug] Terminal UI breakage on switching #7951 / fix(terminal): avoid stale PTY resize after tab reveal #7961 size convergence.

    Our host still matches #10553’s environment: headless Linux serve, DISPLAY=:99, no real desktop window, clients pairing in for agent creates.

    CLI repro (from #10553)

    # works (background):
    orca terminal create --worktree path:/path/to/repo --json
    
    # fails on headless serve (focused):
    orca terminal create --worktree path:/path/to/repo --focus --json
    # → runtime_error: No renderer window available

    Ask

    Please land #10557 (and/or #10370) into a 1.4.x serve build. We can verify immediately:

    1. Web/desktop agent create no longer hits No renderer window available.
    2. Re-run host PTY size histogram — confirm tinies are not a side effect of failed/partial focused creates.
  4. LesleyMurfin commented on Jul 26, 2026

    @LesleyMurfin
    ContributorAuthor

    Capture: browser console error only

    Client:

    [web-runtime-session] failed to create terminal: No renderer window available
    createWebRuntimeSessionTerminalResult @ web-runtime-session-B47J5hpF.js:451
    

    CLI repro on this headless serve (1.4.155), same runtime:

    Command Result
    orca terminal create --worktree path:/path/to/repo --command "echo bg-ok" --json ok:true surface: background
    orca terminal create … --focus --json ok:false runtime_error: No renderer window available
    same with grok --version + --focus same failure

    runtimeId: c1d24190-a8f2-4c8a-8536-b46284ea5443

    asar shows throw in getAuthoritativeWindow() when authoritativeWindowId === null (headless serve).

    Matches #10553 / fix #10557. Error does not land in serve-fg/daemon logs (RPC only).

    Gist (redacted): https://gist.github.com/LesleyMurfin/c64dec4338fbe308a459eceebd41dcdf

  5. LesleyMurfin commented on Jul 26, 2026

    @LesleyMurfin
    ContributorAuthor

    Screenshot: Grok pane blank / fragments (desktop client → headless serve)

    Captured 2026-07-26 01:55 local (Windows taskbar).

    Re-hosted PNG: https://litter.catbox.moe/aa16jp.png

    What the image shows

    • Orca desktop client (Windows) paired to Orca Server (left: "Orca Server …"; bottom status "2 hosts").
    • Active tab Grok; session history: Grok · 8 msgs · grok-4.5, worktree path redacted.
    • Main terminal surface is nearly empty (dark void) with only leftover fragments:
      • partial prior text mid-pane ("…convene experts…", tool lines, "Thinking…", "Good progress. Key findings:")
      • a thin black bar under "Thinking… 4.3s"
      • mangled footer-ish "x hartcuts" (looks like a corrupted "shortcuts" / chrome remnant)
      • token counters still render (e.g. 28K / 508K, 175 / 29.4k)
    • Chrome is fine (sidebar agents list, Agent Session History) — only the agent TUI viewport is dead/blank/fragmented.
    • Left sidebar shows Working · Grok children — fleet still "alive" while this pane is unusable.

    How this maps

    Symptom in shot Related track
    Blank / empty agent viewport #10553 / focused create + headless reveal; or post-create paint failure
    Leftover fragments / corrupted chrome text repaint / WebGL / stale frame class (#7240, #7951, #6071)
    Not a brand/scroll-only issue still not #10613
  6. LesleyMurfin commented on Jul 26, 2026

    @LesleyMurfin
    ContributorAuthor

    Screenshot attached (re-host)

    Previous comment may have a broken image URL (gist rejects binary). Re-hosted:

    PNG (1902×1072): https://litter.catbox.moe/aa16jp.png

    Grok blank/fragmented TUI in Orca desktop → headless serve

    Visual summary: Grok agent tab in Orca Windows desktop (paired to Orca Server). Chrome OK; main TUI viewport almost empty with sparse leftover lines ("Thinking…", partial tool list, corrupted "x hartcuts"), token counters still visible. Sidebar shows Working Grok sessions on redacted project worktrees.

  7. LesleyMurfin commented on Jul 26, 2026

    @LesleyMurfin
    ContributorAuthor

    Screenshot: Grok blank / fragmented TUI (Windows desktop → headless serve)

    Captured 2026-07-26 01:55 local (Windows).

    Grok blank/fragmented pane

    What you see

    • Orca Windows desktop client, tab Grok, paired to Orca Server (status: 2 hosts).
    • Session history: Grok · 8 msgs · grok-4.5 (worktree path redacted).
    • Main agent TUI is almost empty (large dark void).
    • Only leftover fragments: partial tool lines, "Thinking…", "Good progress. Key findings:", a black strip under "Thinking… 4.3s", corrupted x hartcuts text.
    • Token counters still paint (28K / 508K, 175 / 29.4k).
    • UI chrome is healthy (sidebar, agent list, Working Grok children) — only the terminal viewport is unusable.

    This is the "blank / garbled characters" class for #10706 (not #10613 scroll/brand).

  8. nwparker commented on Jul 27, 2026

    @nwparker
    Contributor

    Repro status: skipped (environment blocked)

    Grok TUI on orca serve tiny PTY — needs live headless serve + Grok agent TUI session.

    Not labeling cannot_repro — needs the blocked environment to attempt a full repro.

  9. nwparker commented on Oct 24, 2026

    @nwparker
    Contributor

    Thanks for the production detail. Please retest on 1.4.239+ and share: Orca version on the serve host and client, host OS, Grok CLI version, how the pane is attached (web UI/desktop/mobile) and its size, and stty size output inside an affected Grok pane versus the visible pane dimensions. Does resizing the pane or Ctrl+L recover it? Please redact anything private.

  10. nwparker commented on Nov 8, 2026

    @nwparker
    Contributor

    Hi @LesleyMurfin, we haven't heard back since our last question, so we're closing this for now. If it still happens on the latest version, please open a new issue with your Orca version, OS, steps to reproduce, and logs, and link back to this one. Thanks for reporting!

  11. locked and limited conversation to collaborators on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions