Skip to content

Claude 2.1.209: prompt reaches PTY composer but Enter is swallowed #531

Closed

Description

@Juliusolsson05

Regression

With Claude Code 2.1.209, Agent Code can insert the full prompt into Claude's PTY composer but fail to submit it. The prompt remains visibly editable after the app reports that Enter was written.

Observed screen shape:

❯ yes, work the coverage angle for the licensed sources

The prompt remains in the active composer indefinitely.

Runtime evidence

Recent local paste journals show the failing state machine repeatedly:

  1. delivery:reserved
  2. delivery:acceptance-armed
  3. delivery:prompt-and-enter-written
  4. no user or queue acceptance for 20 seconds
  5. delivery:uncertain with timeout

The failures are mostly short, single-line prompts. That path currently writes prompt + CR atomically and does not first prove that Claude rendered the prompt.

An Electron/node-pty matrix against Claude 2.1.209 confirmed that CR and LF still work in fresh idle and busy sessions, so this is intermittent or session-state-sensitive rather than a globally changed key code. The unsafe invariant remains the atomic short-prompt write: text and Enter have no observable boundary.

Fix direction

Remove the short-prompt atomic shortcut. For every Claude text submit:

  1. capture the active-composer baseline;
  2. write prompt bytes (bracketed only when required to preserve paste semantics);
  3. prove the prompt tail or paste placeholder appeared in the active composer;
  4. send Enter as a separate PTY write;
  5. retain durable user/queue JSONL acceptance as the final success condition.

Acceptance criteria

  • Short prompts are written and visibly absorbed before Enter is sent.
  • Multiline/large pastes retain bracketed-paste handling.
  • A prompt visibly stranded in the active composer is never reported as submitted.
  • Repeated submissions in long-lived and resumed Claude sessions are covered by a PTY regression harness.
  • Busy-session queue submission is covered.
  • Paste journals distinguish prompt absorption, Enter write, and durable acceptance.

Relevant code

  • src/providers/claude/runtime/promptDelivery.ts
  • src/shared/claude/pasteConfirm.ts
  • src/providers/claude/runtime/promptDelivery.test.ts
  • src/providers/claude/runtime/claudeSession.ts
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions