Skip to content

Message enqueuing + steering for Claude and Ada (unify with Codex)#115

Open
germanescobar wants to merge 2 commits into
mainfrom
message-queue
Open

Message enqueuing + steering for Claude and Ada (unify with Codex)#115
germanescobar wants to merge 2 commits into
mainfrom
message-queue

Conversation

@germanescobar

Copy link
Copy Markdown
Owner

Closes #113.

Brings Codex's enqueue + steer model to Claude and Ada with a unified keymap across all three agents.

Behavior

While a run is streaming:

Key Action
Enter Enqueue the message for the next run
Shift+Enter Steer the running turn (composer text, or the first enqueued message if empty)

When idle, Enter sends and Shift+Enter is a newline (unchanged).

  • Steering: Codex uses native turn/steer. Claude/Ada have no native steer, so they stop the run and resume with the steer text only. The composer is disabled during the stop→resume transition to avoid a race.
  • Queue: persisted server-side per session at ~/coding-orchestrator/queues/<sessionId>.json, drained one-at-a-time on clean completion. Failures/cancellations leave the queue intact.
  • Durable, server-driven advancement: the stream handler can run headlessly, so the queue advances even when no client is connected (you're on another session, reloaded, or closed the app). The client observes server-driven runs via a runtime poll and keeps the queue list in sync.
  • UI: a visible list above the composer shows queued messages with a remove action.

Implementation

  • server/lib/session-queue.ts — per-session queue persistence (enqueue/list/remove/dequeueFirst/clearQueue) with per-session locking; paths.ts helpers.
  • server/routes/sessions.ts — queue CRUD routes; handleSessionStream extracted and invoked headlessly by advanceSessionQueue on clean completion (both CLI and Codex app-server paths); queue cleared on archive.
  • client/src/api.ts — queue API client.
  • client/src/pages/SessionView.tsx — unified keymap, enqueue/steer handlers (native + emulated), queue list UI, server-driven run observation.

Testing

  • server/lib/__tests__/session-queue.test.ts — 7 unit tests (ordering, dequeue, remove, isolation, clear, concurrency).
  • Full suite: 83/83 pass; server + client tsc --noEmit clean.
  • ⚠️ The end-to-end server-driven advancement chain (spawning a real agent) is manually verified; an automated test would need a fake-provider harness.

🤖 Generated with Claude Code

germanescobar and others added 2 commits June 14, 2026 14:46
Bring Codex's enqueue + steer model to Claude and Ada with a unified keymap.

While a run is streaming:
- Enter enqueues the message for the next run.
- Shift+Enter steers: Codex uses native turn/steer; Claude/Ada stop the
  run and resume with the steer text only. The composer is disabled during
  the stop->resume transition to avoid a race. With an empty composer,
  Shift+Enter promotes the first enqueued message to a steer.

The queue is persisted server-side per session under
~/coding-orchestrator/queues/<sessionId>.json and drains one-at-a-time on
clean completion. Advancement is server-driven: the stream handler can run
headlessly, so the queue advances even when no client is connected (other
session, reload, or app closed). Failures/cancellations leave the queue
intact. A visible list above the composer shows queued messages with a
remove action.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts:
#	server/routes/sessions.ts
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.

Message enqueuing + steering for Claude and Ada (unify with Codex)

1 participant