Skip to content

[Feature]: have a queue up mode so the messages are not default to interrupt at the next tool call. #1881

Description

@userna

Problem or use case

currently the messages default interrupt the ongoing task. In the case when the ask is different from the ongoing tasks, it may distract or misdirect the agent to abandon current work.

Proposed solution

Image similar to the way codex queue up messages. Sometimes I don't want the messages to interrupt the work on going, I just want to queue up additional tasks so that they get picked up at the end of the ongoing tasks. This also enables the session to run longer.

Alternatives or additional context

No response

Activity

  1. added
    enhancement
    on May 15, 2026
  2. nwparker commented on May 29, 2026

    @nwparker
    Contributor

    Triage update (2026-05-29): I inspected #1881 against current origin/main and do not see a safe tiny implementation slice yet. The requested behavior is not just a UI toggle; it needs a send-mode contract and a durable queue tied to agent/session state.

    Evidence from origin/main:

    • src/main/runtime/orca-runtime.ts and src/main/runtime/rpc/methods/terminal.ts: terminal.send accepts text / enter / interrupt, writes bytes directly to the PTY, and returns only accepted/bytes-written metadata. There is no queued mode or deferred-delivery result.
    • src/cli/handlers/terminal.ts: orca terminal send exposes --interrupt, but no queue/defer mode.
    • src/renderer/src/runtime/runtime-terminal-inspection.ts: local and remote PTY input is sent immediately; the remote path also goes through terminal.send.
    • src/renderer/src/lib/new-workspace.ts: the legacy followupPrompt path waits for an agent foreground process and then sends ${prompt}\r; that is startup delivery, not “deliver after the current task finishes.”
    • src/renderer/src/lib/agent-paste-draft.ts and src/renderer/src/lib/launch-agent-in-new-tab.ts: draft / submit-after-ready paths use bracketed paste or native prefill for startup/new-session prompts, not queued follow-ups to an already-running agent.
    • src/renderer/src/store/slices/terminals.ts: pendingStartupByTabId, pendingSetupSplitByTabId, and pendingIssueCommandSplitByTabId are one-shot in-memory startup maps, and they are not part of WorkspaceSessionState in src/shared/types.ts.
    • src/shared/tui-agent-config.ts and src/shared/tui-agent-startup.ts: prompt injection is provider-specific (argv, prompt flags, interactive flags, stdin-after-start, native prefill env/flags), so queued delivery cannot be one generic paste path without a provider contract.
    • src/main/runtime/orchestration/db.ts: there is a persistent queue-like store for orchestration messages, but that is inter-agent/coordinator messaging, not user prompt delivery to terminal-backed agents.

    Before implementation, this needs these contracts:

    1. Send mode: define “send now / interrupt” vs “queue” semantics, default behavior, CLI/API names, and whether queued items become normal user turns.
    2. UI command: decide where the mode lives across desktop composer, terminal actions, mobile, and CLI; define visible queue count/state, shortcut behavior, and copy for “queued” vs “sent.”
    3. Queue storage: define a durable schema keyed by worktree, tab, pane key / PTY / session, agent/provider, order, timestamps, and delivery attempts; also define restart, closed-tab, and max-size behavior.
    4. Delivery-on-idle: decide which signal releases the next message, such as hook state (done, waiting, blocked), tui-idle, or provider-specific idle markers, and how to avoid sending into permission prompts or tool calls.
    5. Cancellation/editing: define edit/delete/reorder rules before delivery, delivered vs pending states, and behavior when the terminal, agent, worktree, or SSH session exits.
    6. Provider / SSH / remote: define parity for local terminals, SSH terminals, remote runtimes, and mobile floor ownership; provider-specific delivery may need native queue support, bracketed paste, or an explicitly degraded fallback.

    Suggested first bounded issue: add a typed AgentPromptQueue contract with tests for enqueue / dequeue / cancel / serialize, without UI or PTY writes. A second slice can wire delivery to one provider/session class after the idle and delivery semantics are approved.

  3. Jinwoo-H commented on May 30, 2026

    @Jinwoo-H
    Contributor

    I agree this would be helpful

  4. self-assigned this
    on May 30, 2026
  5. added
    size/m
    on Jun 10, 2026
  6. added theissue type on Jul 12, 2026
  7. smixs commented on Aug 31, 2026

    @smixs

    Data point from driving Claude Code through Orca, in case it helps scope this.

    Orca's default send is already non-interrupting — terminal.send/sendTerminalAgentPrompt bracketed-pastes the text, sanitizes ESC to an inert literal, then writes a single \r. Verified with a live probe: sending mid-turn to Claude Code 2.1.251 leaves the running turn alone and the message is queued by the CLI itself.

    What is missing is the guarantee and the observability: the CLI has no way to say "deliver only when the target is idle" (only the desktop notes path does terminal.wait for: tui-idle), and no way to say "queue this, never interrupt". For multi-agent setups where executors report back into a lead session with orca terminal send --text … --enter, that guarantee is the whole ballgame — the blast radius on the Claude Code side is severe: a single interrupt gesture while the lead is idle waiting on background subagents terminates all of them at once, irreversibly (system/agents_killed, "N background agents were stopped by the user"). Minutes of work, gone, no undo.

    Concretely, what would make this safe for CLI-driven fan-in:

    • orca terminal send --queue (or --send-mode queue|immediate|when-idle): buffer in Orca, deliver at the next observed idle boundary, never write mid-turn.
    • Durable queue with an explicit outcome in --json (queued / delivered / dropped), so the sender can wait on it instead of polling terminal read.
    • Same contract for the desktop composer, so the UI and CLI cannot disagree.
  8. nwparker commented on Dec 1, 2026

    @nwparker
    Contributor

    Implemented in PR #36588 (0d94c0ba8f6e39f950c7ab032403d0fe6203b9c6), which makes queueing follow-up messages the default in native chat (src/shared/native-chat/input/composer/native-chat-follow-up-behavior.ts, ChatBehaviorSetting.tsx, use-structured-agent-session.ts), while terminal agent sends were already non-interrupting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementsize/m

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions