Skip to content

[Bug]: Orchestration message pointer is typed + submitted over the user's unsent prompt draft #22651

Open

Description

@kaankolcu

Orca version

1.4.209 (macOS)

Details

When a Run message arrives for a coordinator terminal with no live waiter, Orca types You have N orchestration messages. Run ... plus Enter into the coordinator's agent prompt. If the user is mid-way through typing a prompt, that unsent draft is submitted together with the pointer.

Worker heartbeat messages trigger this repeatedly during normal runs.

Expected

Do not inject (or hold the injection) while the prompt has a draft. detectTerminalComposerDraft already reports the draft on orca terminal read --screen, so the delivery path could check it before writing.

Notes

  • Seen with both Claude Code and Codex coordinators.
  • For Codex, draft detection only works on the rendered screen: CODEX_FOOTER_LINE does not match a footer that includes the reasoning effort (e.g. <model> low · ...), so the stream-based check misses Codex drafts.

Activity

  1. AmethystLiang commented on Sep 24, 2026

    @AmethystLiang
    Contributor

    Very valid. Looking into improving this for composer that we can detect draft

  2. soonJ817 commented on Sep 30, 2026

    @soonJ817

    Still reproducible on 1.4.217 (macOS, Claude Code coordinator).

    The pointer is written to the PTY and a separate \r follows ~500 ms later (enterTimer in deliverPendingMessages), so an unsent draft is submitted together with the pointer. In our runs the trigger is almost always worker heartbeats.

    Workaround that avoids it today: keep a waiter whose --types includes heartbeat (a loop running check --wait --types worker_done,escalation,question,heartbeat that acks heartbeat-only deliveries). Pointer delivery skips types that have a live waiter, so nothing is typed into the prompt. Heartbeats that arrived before the loop got delivered_at set (pointer typed); after it they were consumed silently.

    Gap: between waits (right before/after processing a delivery) the pointer can still land on a draft. A draft check before writing (as proposed above), or keeping heartbeats out of pointer delivery (#14910 / #15173), is still needed.

  3. ixiion001 commented on Oct 6, 2026

    @ixiion001

    The same happens through the CLI, not only with the orchestration nudge (1.4.220, macOS, Claude Code coordinator):

    1. The user types ZEBRA half line into the agent's prompt and does not press Enter.
    2. orca terminal read --screen --json shows it: .result.terminal.draft = "ZEBRA half line".
    3. orca terminal wait --for tui-idle returns satisfied: true at once.
    4. orca terminal send --text "…" --enter is accepted, and the agent receives one prompt: the user's half line and the
      sent text joined. Twice in two tries.

    A suggestion: wait --for tui-idle not satisfied while draft is non-empty (or a --for empty-draft condition), and
    terminal send refusing, or holding, while a draft is present unless --force. Until then we read draft before
    every send.

  4. Race428 commented on Oct 7, 2026

    @Race428

    Reproduced on 1.4.221 with a Claude Code coordinator. The pointer was submitted together with the user's draft, so the agent received a single turn reading:

    You have 1 orchestration message. Run `orca orchestration check --run run_…`.
    ok
    

    where ok was the user's unsent reply to an earlier question. In this Run most pointers were for heartbeat or status ("Setup succeeded for worker …") deliveries, i.e. nothing the coordinator needed to act on.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions