Skip to content

[feature] Inspect, edit, and cancel queued chat and shell commands #284

Description

@AetherAI3

Problem

Users can type ahead or /queue while a turn runs, but the queue only emits a short echo and later drains. There is no way to inspect the whole queue, remove a mistaken command, or see whether a failed turn left items pending.

Evidence: src/commands/chat.ts, src/commands/chat.ts, and src/commands/chat.ts. Existing queueing landed in PR #9; this is management of that queue.

Proposed outcome

Give pending entries stable local IDs and explicit list/edit/remove/clear operations. Show each entry as chat, user shell, or shell-share action. Display pending count and disposition after a task failure or cancellation.

Constraints and alternatives

Keep queue operations local and responsive during an active turn; they do not invoke a model. Preserve strict ordering and distinguish the running entry from editable pending entries. An explicit shell command remains the user's local action and never becomes model context just because it was queued.

Define shell-share binding visibly: if “latest at execution” is used, say so; a staged preview from #281 must remain bound to its reviewed command. Keep queued shell text out of ordinary chat history/exports. Set an explicit queue size/byte bound with useful feedback.

Acceptance

  • Users can inspect, edit, remove, and clear pending entries without disrupting the active tool or draft.
  • A removed shell command makes zero process calls; a removed chat makes zero model calls.
  • Edited entries retain their position/type; invalid edits are rejected without silently reclassifying input.
  • Failure, cancellation, reconnect where supported, and shell state loss show exactly which entries remain or were discarded. They cannot silently resume dropped work.
  • TTY tests cover queue updates while streaming, type-ahead, and mixed entry types; non-TTY behavior is documented.

Priority: P2. Small control feature building on #244. Source reviewed at ca4180d (0.4.0 candidate). This ticket is an implementation spec; live service qualification remains separate.

Activity

  1. AetherAI3 commented on Oct 6, 2026

    @AetherAI3
    OwnerAuthor

    Closed by #315 — squash commit 52a890c on main. main's tree is byte-identical to the CI-verified head e9af312 (git diff 52a890c e9af312 is empty).

    What landed

    • src/commands/console_queue.ts adds ConsoleQueue. It gives entries session-stable ids (q1, q2, … never reused), keeps strict FIFO order, and enforces a 32-entry / 64 KiB (UTF-8) bound.

    • New commands: /queue [list], /queue edit <id> <text>, /queue remove <id>, /queue clear, /queue resume.

      • They work mid-stream and while a model switch is pending.
      • They never call a model, never start a process, and never enter history.
    • Each entry is labelled chat, user shell, shell reset, shell profile or shell-share. The running entry is listed separately and cannot be edited.

    • Shell-share binding: a queued /shell-result send binds to the reviewed preview's command id. If that preview was cancelled or replaced, it refuses and sends nothing. With nothing staged, it is not queued. Other share actions show "stages the latest shell result at execution".

    • Dispositions, each listing the exact ids affected:

      Event Pending entries
      Chat failure (incl. 401) Paused until /queue resume
      Ctrl+C, shell state loss, /shell-reset, profile change, /auth new, exit Discarded

      Nothing resumes silently. Before this change, a failed turn's queue drained after the next submit.

    • Line mode (non-TTY) has no pending queue, and /queue <task> runs as the next line. This is documented in docs/LOCAL_SHELL_SESSION.md → "Queued input".

    Acceptance → evidence

    Criterion Test
    Inspect/edit/remove/clear during an active turn without disrupting it or the draft TTY: list, edit and remove mixed queued entries while a turn streams…
    Removed shell → 0 process calls; removed chat → 0 model calls same test: the marker file is never created, and fetch bodies = 2 (q1 + edited q2)
    Edits keep position/type; invalid edits rejected unchanged edits keep id, position and type… (unit) + TTY chat→shell / shell→chat / running-entry rejections
    Failure / cancellation / exit show exactly what remains or was discarded; no silent resume TTY: a failed turn pauses…, TTY: cancelling a streaming turn discards…, TTY: leaving the console with held entries…
    Shell-share binding a queued shell-share send only sends the preview it was bound to
    Bounds + feedback bounds reject with useful feedback…
    Non-TTY documented and tested line mode has no pending queue…

    CI and local runs

    Follow-ups not covered here:

  2. AetherAI3 commented on Oct 6, 2026

    @AetherAI3
    OwnerAuthor

    Post-merge verification of main 52a890c5291383dda22593bcf35a600fd9fc3251 found residual acceptance gaps despite #315's successful feature landing: malformed pasted ID-based queue controls could become ordinary chat; command-ID-only shell-share binding permitted changes to the reviewed bytes; and shell generation reset did not consistently invalidate pending work. #309 now contains a narrowly reconciled fix preserving #315's queue design, PowerShell profiles and steering. It also restores an edited attachment draft exactly when a full queue rejects admission.

    Synthetic regression evidence: 60 focused tests passed, 4 platform skips, including real busy-TTY wire/history checks and zero-process stale-queue replay checks. Full suite: 3,409 passed, 15 skipped, one independently reproduced README/command-manifest baseline failure. Required CI/admin and baseline gates remain unresolved, so the current issue closure should not be used as proof these follow-up fixes have landed. Superseded duplicate PR #311 is closed without merge; #309 is the remaining follow-up.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions