Skip to content

Support queued mid-turn user messages / active-run steering #52

Description

@mimir-carreira

Feature request

Add a first-class way for users to queue arbitrary follow-up messages while an agent run is already in progress, and fold those messages into the active turn at a safe boundary.

Current behavior observed

In the current TUI flow, OpenClaudia appears to support interruption and explicit modal input, but not general mid-turn steering:

  • while is_waiting is active, normal input is routed through streaming mode;
  • streaming mode handles interruption, but ordinary typed input is not appended as a queued user message;
  • paste is ignored while is_waiting, pending_permission, or pending_user_question is active;
  • permission prompts and ask_user_question can receive answers mid-turn, but only because those are explicit runtime prompts from the agent/tooling.

That means if the user realizes "actually, also check X" or "ignore that file; use Y instead" during a long tool/model loop, their choices are basically to interrupt/restart or wait for the run to finish.

Desired behavior

Allow the user to type/paste a normal follow-up while a run is active. The runtime should store it in an inbound buffer and inject it into the active conversation at the next safe model boundary, for example:

  1. User sends message while run is active.
  2. UI shows it as queued/pending, not dropped.
  3. Current tool-call batch finishes normally.
  4. Before the next provider request, the queued message(s) are appended to the conversation/context as user input.
  5. The agent can respond to the updated instruction without forcing a full interrupt/restart.

Suggested semantics

This probably wants runtime support rather than just prompt convention. A useful initial shape could be:

  • steer active run: default for ordinary follow-up messages during an active run;
  • queue after run: option for messages that should start a separate turn after the active run completes;
  • interrupt: existing behavior for hard stop/cancel.

Implementation-wise, the important invariant is that injection happens only at a safe boundary: after current tool execution finishes and before the next provider request. That avoids mutating context while tools are running, but still lets users correct/steer long-running work.

Acceptance criteria / edge cases

  • Typing or pasting during an active run creates a durable queued message visible in the UI.
  • Multiple queued messages preserve order.
  • Queued messages appear in transcript/history with clear timing/attribution.
  • If the agent is waiting on a permission prompt or ask_user_question, input intended for that modal should still route to the modal rather than the general steering buffer.
  • There is an explicit way to choose "send after current run" for unrelated messages, so multi-topic chats do not accidentally collapse into one active turn.
  • Interrupt/cancel remains available and distinct from steering.

Why this matters

For longer autonomous runs, users often need to add context, correct a mistaken premise, or redirect the agent before the run completes. Mid-turn message folding makes that possible without losing the active run's state or forcing a restart.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions