Skip to content

Steer the running turn instead of queuing messages - #2

Merged
tdwd merged 1 commit into
mainfrom
feat/mid-turn-steering
Jul 29, 2026
Merged

Steer the running turn instead of queuing messages#2
tdwd merged 1 commit into
mainfrom
feat/mid-turn-steering

Conversation

@tdwd

@tdwd tdwd commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

What

Typed-while-busy input was held in a local queue and only handed to claude one-per-turn after the result event, so it could never influence work already in flight. But claude's stream-json subprocess accepts a user envelope mid-turn and injects it at the next step boundary (verified with a live probe: a steering message sent ~5s into a 3-step tool run was honored instead of the remaining steps, folded into the same turn).

This sends immediately when busy so the message steers the running turn, landing in the transcript inline.

Changes

  • keys.go:sendTurn — busy path now calls engine.Send right away + adds the message inline; first-prompt session label only captured when opening a turn.
  • Retires the now-dead local queue: pending tray (chrome.go/render.go/view.go), flushQueue (update.go/stream.go), up-arrow edit-queued + dequeueLast (keys.go), the queue field (model.go), and the esc-clear-queue stage — Esc now goes straight to interrupt, which is the undo for a mis-sent steer.
  • Tests: removed queue_test.go + tray-budget test; repurposed the frame-fit test into a height-fit regression guard.
  • README updated (steering, not queueing).

Net: −235 / +40 across 10 files. Build + go vet + full test suite green.

Typed-while-busy input was held in a local queue and only handed to
claude one-per-turn after the result event, so it could never influence
work already in flight. But claude's stream-json subprocess accepts a
user envelope mid-turn and injects it at the next step boundary. Send
immediately when busy so a message steers the running turn, landing in
the transcript inline.

Retires the now-dead local queue: pending tray, flushQueue, up-arrow
edit-queued / dequeueLast, the queue field, and the esc-clear-queue
stage (Esc now goes straight to interrupt, which is the undo for a
mis-sent steer).
@tdwd
tdwd merged commit 8c67776 into main Jul 29, 2026
@tdwd
tdwd deleted the feat/mid-turn-steering branch July 29, 2026 13:28
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.

1 participant