Skip to content

Claude composer gate reads cached/attribute state that can be stale or misclassify a draft #1294

Open

Description

@Juliusolsson05

P3s with P1 impact (the agent's prompt is typed into and submitted with a human draft):

  • The gate reads the cached composerState, recomputed only on screen events (ClaudeCodeHeadless.ts:586-588,1479). If the documented pendingWrites stall (HeadlessTerminal.ts:531-575) stops screen events, a stale empty lets delivery append to a draft typed afterwards.
  • Attribute path plain > 0 = drafted (HeadlessTerminal.ts:490-492, ScreenParser.ts:179-181) reads empty for a one-character draft under the inverse cursor, an [Image #1]-only draft with the cursor at the chip start (the whole chip is inverted), and native voice interim text (dim).

0 recorded attribute frames. Severity P3.

Found by the Stage 3 C1 hunt; lines are origin/main d525d45 and pinned submodules. Findings: temp/quality-loop/hunt-c1.md.

🤖 Generated with Claude Code

Activity

  1. Juliusolsson05 commented on Sep 27, 2026

    @Juliusolsson05
    OwnerAuthor

    Closed attempt: #1390 (branch fix/claude-live-composer-gate, kept; reopenable). It read the composer live, right before writing a prompt. Review round 1 found blockers that this issue must still solve:

    • P1: a status-like continuation row hides a human draft. parseClaudeComposerState ignores any continuation row that contains a status marker (claude-code-headless ScreenParser.ts). A draft whose second line is plan mode reads as empty, so the agent prompt is appended to the human draft and Enter submits both. This was reproduced on a 30-column HeadlessTerminal. The fix belongs in the claude-code-headless parser (a package PR).
    • P1: a promised orchestration prompt can vanish. SessionManager.deliverPromptWhenReady settles after ONE attempt once the cached gate says ready. A live refusal (retry-after-resolve) after that deletes the pending slot, even though the parent was told promptPending: true. A retry-safe, zero-write refusal must keep waiting. This overlaps W2's fix(claude): reclaim a prompt Agent Code stranded in the native composer #1358 (sessionManager.ts / promptDelivery.ts).
    • P2: a wrapped dim placeholder is refused as a draft at narrow widths. The parser treats every non-status continuation row as content. The package's "wrapped placeholder" test uses an 80-column terminal, so its text never wraps.
    • P2: the image route has no gate test. Moving the live guard below the image branch passed all checks.

    Also noted: native voice interim text painted dim can still read as empty (no recording yet).

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

    bugSomething isn't workingclass:C1-prompt-deliveryPrompt delivery inferred from the terminal screenprovider:claudeAffects Claude Code integrationsev:P3Minortype:bugSomething works wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions