Repository navigation
Description
Problem
While Astra is working, users need to express two different intentions:
- Guide the current task: “Use the existing helper instead.”
- Queue subsequent work: “After this task finishes, also update the documentation.”
For ordinary conversational input during a bound, guidance-admitting run, Enter takes the first route (GuideCurrentRun). Wording such as “after you finish” does not select a different delivery mechanism: the message can still reach the current run. Users currently cannot explicitly choose the next-turn queue while guidance remains available.
This is a feature request for an explicit delivery choice, rather than a report that all active-run input is mishandled.
Verified current behavior
Inspected against main at 2873a950f2c9fea00343757933e96070d1631596.
active_submission_routes_to_next_turnanddefer_follow_up_before_run_bindalready defer input when visible output has settled, foreground ownership has transferred, guidance admission has closed, or input arrived beforeRunBound. Pre-bind deferral also keeps later messages on the same FIFO to prevent overtaking.submit_active_run_guidanceuses the durable run-intent API for current-run guidance. Another guidance submission in flight restores additional ordinary input to the composer and asks the user to wait.BottomPane::queue_next_turn_submissionalready has a client-owned FIFO, queue previews, and recovery/handoff behavior. Its typed entries distinguish interactive input from conversation continuations with captured targets.UserIntentDeliverycurrently exposes onlyGuideCurrentRun. The local next-turn queue is not a durable server-accepted follow-up API.- Slash commands retain local dispatcher semantics; some active-run controls/navigation execute immediately. They should not be described as universally queued or sent to the model.
Proposed behavior
Expose a dedicated Queue follow-up composer action, distinct from normal submission.
| Situation | Expected behavior |
|---|---|
| Active run; normal Enter | Preserve existing guidance routing and its existing fallback rules. |
| Active run; Queue follow-up | Retain the input in the existing next-turn FIFO, without submitting it as guidance or making it visible to the current run's model context. |
| Guidance submission is in flight | Explicit follow-up can still enter the local queue; it does not need a guidance acknowledgement of its own. |
| No active run or held backlog | The follow-up action behaves like ordinary submission. |
| Existing backlog, settlement, or modal interaction | Preserve existing FIFO, focus, and safe-release gates. |
Explicitly queueing a message must not itself latch all later Enter submissions onto the next-turn lane. Users should still be able to guide the current run afterward when guidance admission permits it. The existing pre-bind latch remains a separate ordering rule.
For this feature, a follow-up starts through the ordinary next-session-turn path after the existing lifecycle owner permits handoff. A completed tool batch or final-looking text is insufficient. Preserve successful-settlement gates and any already-authorized foreground lifecycle transfer; do not allocate a competing run early.
Shortcut and UI compatibility
The original suggestion of Alt+Enter needs an explicit compatibility decision: Astra currently treats both Shift+Enter and Alt+Enter as newline in TextArea::handle_key.
Choose an available, terminal-compatible binding, or deliberately migrate Alt+Enter with documented replacement newline behavior. Preserve paste-burst handling and approval/ask-user/menu focus precedence. The action should operate on the composer, not become a global shortcut that unexpectedly submits input from another view.
Show the delivery choice and a clear “queued for next turn” acknowledgement/preview. Reuse the existing queue UI, and ensure its hints remain accurate when queued follow-ups coexist with current-run guidance. Local enqueueing must not appear as remote acceptance or application.
Implementation scope and API boundary
Recommended first milestone: add the explicit TUI action and reuse the existing queue, settlement, restoration, and ordinary submission paths. This exposes an existing client capability without introducing a second runtime scheduler. Queue editing/removal and persistence across client restart can be separate enhancements; the first milestone must accurately describe its process-local custody.
The original proposal for a matching run-control/API operation is useful, but requires a separate end-to-end contract before being advertised. If included in this implementation, define:
- Whether it creates a subsequent canonical session turn or continues the same run at natural stop; this issue recommends the existing next-session-turn behavior for the TUI milestone. Pi's in-loop follow-up mechanism does not establish Astra's durable run semantics.
- The owning session/run, durable acceptance, stable identity/idempotent retry, ordering, delivery/disposition events, and behavior on cancellation, failure, pause, reconnect, or session changes.
- A shared implementation across CLI, Server, and other API consumers, with authorization and execution-slot fencing preserved.
Do not add a follow-up variant to UserIntentDelivery solely for local queue display: its own contract requires runtime, durable API, and user-facing action to consume the same semantics. API work may be split into a linked follow-on issue rather than blocking the first milestone.
Acceptance criteria / regression coverage
- During a bound, guidance-admitting run, normal Enter still submits guidance; Queue follow-up makes no current-run intent request and does not enter current-run model context.
- Queueing a follow-up does not prevent a subsequent Enter from guiding that run, subject to existing admission/fallback rules.
- Multiple explicit follow-ups and existing next-turn entries preserve FIFO order and start through the ordinary submit path only at a permitted handoff; input submitted during release cannot overtake the backlog.
- Explicit enqueueing works before
RunBound, during tool execution, while guidance is in flight, and around settlement, without duplicate submission or competing session runs. Empty input is a no-op. - Interrupted/failed/not-started turns, unresolved ownership, session changes, and an existing draft use the existing hold/restore rules; client-owned text is recoverable rather than silently dropped or sent to a different conversation. Server-owned guidance is not replayed as a new turn merely because its acknowledgement is delayed.
- Newline, paste-burst, slash/control dispatch, and approval/ask-user/menu focus behavior remain correct under the chosen binding.
- Queue acknowledgement/preview and hints distinguish queued follow-up from guidance. Document the shortcut, release semantics, and persistence limits.
- Add deterministic keyboard/action-routing and event-loop handoff/recovery tests, extending existing queue tests. If the durable API is included, add public API/runtime contract tests for acceptance, retry, ordering, and terminal outcomes.
References and related issues
Pi demonstrates the UX distinction with Enter for steering and Alt+Enter for follow-up (Ctrl+Q on Windows/WSL); its agent loop checks follow-ups at natural completion. See usage, keybindings, and agent semantics. This is a UX reference, not a requirement to duplicate that loop.
- Bug: follow-up input is rejected while the active run is still starting #872 and [Bug] TUI exposes settlement-fenced 409 for follow-up input after visible reply #852: closed startup/settlement fallback issues. This request adds deliberate queue selection while guidance is still available.
- [Feature]: Decouple post-turn summary display and composer readiness from full server settlement #910: related composer/visible-output settlement UX; changing summary timing is independent of this feature.
- Canonical owners: runtime lifecycle and client surfaces.
Activity
[-]Support explicit follow-up messages while a run is active (separate from guidance)[/-][+][Feature]: Explicitly queue next-turn follow-ups separately from current-run guidance[/+]feat(tui): add explicit next-turn follow-up submission (matrixorigin#992