Skip to content

feat(console): inspect, edit, and cancel queued chat and shell commands (#284) - #315

Merged
AetherAI3 merged 2 commits into
mainfrom
feat/issue-284-queue-management
Oct 6, 2026
Merged

AetherAI3 merged 2 commits into
mainfrom
feat/issue-284-queue-management

Conversation

@AetherAI3

Copy link
Copy Markdown
Owner

Closes #284.

Users could type ahead or /queue while a turn ran, but the queue was an invisible array: no way to see it, fix a mistaken entry, or know what survived a failure. This makes the queue a bounded, local, inspectable object with stable ids and explicit operations, and makes every failure/cancellation say exactly what happened to pending work.

  • src/commands/console_queue.ts (new) — ConsoleQueue: ids q1, q2, … (never reused), strict FIFO, 32-entry / 64 KiB bound, immutable entry replacement, hold/resume, strict /queue subcommand parser (/queue clear the cache is still a task).
  • /queue [list] | edit <id> <text> | remove <id> | clear | resume — handled before the pending-switch gate and mid-stream; never calls a model, never starts a process, never enters history (edits can carry shell text).
  • Edits keep position and type — replacement is classified like typed input; chat→shell, shell→chat, slash, or edits to share/reset actions are rejected with the entry unchanged. The running entry is shown separately and cannot be edited.
  • Shell-share binding ([feature] Preview and edit a shell result before sharing it with the model #281) — a queued /shell-result send binds to the reviewed preview's command id and refuses if that preview was cancelled or replaced; it is not queued at all with nothing staged. Other share actions state "stages the latest shell result at execution".
  • Dispositions — chat failure (incl. 401) pauses pending entries until /queue resume (a new submission runs alone); Ctrl+C, shell state loss, /auth new, and exit discard them. Each prints the exact entries kept or dropped. Previously a failed turn left entries that silently drained after the next submission.
  • Line mode — no pending queue exists; management commands say so, /queue <task> runs as the next line.
  • Docs: docs/LOCAL_SHELL_SESSION.md "Queued input"; manifest + generated command reference.

Test plan

  • test/console_queue.test.ts — parser, ids, order, edits/rejections, running entry, bounds (UTF-8 bytes), hold/resume/clear, binding text (7 tests)
  • test/console_queue_tty.test.ts — raw TTY while a hosted turn streams: mixed type-ahead, list/edit/remove, removed shell → no file, removed chat → no model call, history excludes /queue + shell text; failure pause + resume; cancel discard; exit discard; bound send; line mode (7 tests) — green on Windows locally
  • Full suite on self-hosted Linux CI

🤖 Generated with Claude Code

AetherAI3 and others added 2 commits October 6, 2026 17:42
…ds (#284)

Queued type-ahead now lives in a bounded, local ConsoleQueue with
session-stable ids (q1, q2, ... never reused) and explicit operations:
/queue [list], /queue edit <id> <text>, /queue remove <id>, /queue clear,
/queue resume. Queue commands work mid-stream and during a pending model
switch, never call a model or start a process, and stay out of history.

- Each entry shows its type (chat, user shell, shell reset, shell-share)
  and the running entry is listed separately and cannot be edited.
- Edits are classified like typed input and must keep the entry type;
  invalid edits are rejected and leave the entry unchanged.
- A queued /shell-result send binds to the reviewed preview's command id
  and refuses to send anything else; other share actions state that they
  use the latest result at execution.
- Bound: 32 entries / 64 KiB; a rejected enqueue keeps the draft.
- Failure pauses pending entries until /queue resume; cancellation, shell
  state loss, /auth new and exit discard them, and every disposition lists
  exactly which entries remained or were dropped.
- Line mode has no pending queue; /queue <task> runs as the next line.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ape test

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AetherAI3
AetherAI3 force-pushed the feat/issue-284-queue-management branch from 607e9e3 to e9af312 Compare October 6, 2026 21:43
@AetherAI3 AetherAI3 closed this Oct 6, 2026
@AetherAI3 AetherAI3 reopened this Oct 6, 2026
@AetherAI3
AetherAI3 merged commit 52a890c into main Oct 6, 2026
2 of 14 checks passed
@AetherAI3
AetherAI3 deleted the feat/issue-284-queue-management branch October 6, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant