Skip to content

Orbit: multi-slot prompt queue (stack thoughts while agent works) #60

@nekrut

Description

@nekrut

Current state

`app/src/renderer/app.ts:762-809` implements a single-slot queue: submitting while the agent is mid-turn stashes the message into `pendingMessage`, shows a `↓ queued` pill, and auto-fires when `agent_end` arrives. A second submit overwrites the first.

Request

Multi-slot queue — stack 2+ prompts while the agent grinds on a long tool turn (~30s+ in bioinformatics workflows).

UX sketch

Above the input, a small stacked list of queued messages, each row ~80 chars preview + ✕ to remove. New submits append to the bottom; current turn ends → top dequeues + auto-fires → repeat until empty.

```
┌ pending: 2 queued ───────────────────┐
│ 1. also check chrM coverage ✕ │
│ 2. and the variant filter param ✕ │
└──────────────────────────────────────┘
[ chat input... ] [send]
```

Collapsible: `3 queued ▾` collapsed by default once >2 items, expand on click, so the chat doesn't get pushed up.

Behavior decisions

  • Each queued message is its own turn. Concatenating into a single "also X, also Y" prompt derails the agent on unrelated topics; sequential preserves per-turn coherence.
  • Abort current turn leaves the queue intact (Esc cancels this turn, not its followups). Add a separate "clear queue" affordance — perhaps clicking the "3 queued ▾" header.
  • Edit a queued message: out of scope for v1; user removes + retypes.
  • State drift (turn 1's response invalidates queued message 2): user prunes manually with ✕. We don't auto-prune.
  • Slash commands: handled inline (`/help`, `/cost`) bypass the queue, same as today. Slash commands that route to the LLM (`/summarize`, etc.) join the queue.

Files touched

  • `app/src/renderer/app.ts` — replace `let pendingMessage: string | null` with `let pendingQueue: string[]`. Update `updateQueuedIndicator`, `clearPendingMessage` (becomes `clearQueue`/`removeFromQueue(idx)`), `submit` (push instead of overwrite), and `flushPendingMessage` (becomes `flushNext` — pop FIFO, fire, leave the rest).
  • `app/src/renderer/index.html` — replace the single `#queued-indicator` span with a collapsible list region.
  • `app/src/renderer/styles.css` — list rows, collapsed-summary style.

Out of scope

  • Reordering queued items (drag handle) — defer until users ask for it.
  • Persisting the queue across restarts — same.
  • Inline editing of queued items — same.

Why now

Filed during testing — agent on Galaxy workflows takes long enough that single-slot "only the latest sticks" is annoying when you want to jot down two followups while the current one finishes.

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