Skip to content

surface.read_text scrollback readback runs entirely on main thread, can starve UI under heavy agent workloads #24

Description

@arzafran

Tracking upstream cmux manaflow-ai#6500 — applicable to our fork but needs a product/scope decision.

Assessment: Confirmed: v2SurfaceReadText at Sources/TerminalController.swift:5808 wraps the entire read in v2MainSync, and readTerminalTextBase64 calls ghostty_surface_read_text three times on main when includeScrollback=true. CLAUDE.md socket threading policy explicitly lists surface.read_text as a main-thread command due to snapshot-consistency requirements. Moving the heavy C call off-main requires first verifying ghostty_surface_read_text thread-safety in the Ghostty Zig implementation. Needs both a thread-safety audit and a policy decision.

Upstream: manaflow-ai#6500

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferredDecision made: backlog, no work scheduled nowtech-debtKnown latent issue / maintenance debt

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions