Skip to content

Type-ahead and queue the next message during a run (#92) - #115

Merged
currentbits merged 1 commit into
mainfrom
coder/composer-is-hard-disabled-during-runs-al-389f73
Aug 16, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/composer-is-hard-disabled-during-runs-al-389f73

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #92.

Why

ThreadView passed disabled={isWorking || isArchived} to the Composer, which disabled the textarea itself. While an agent worked you could not draft — let alone queue — the next instruction, so every run meant babysitting the spinner.

What changed

  • src/useCoder.ts — startRun against a thread that is already working holds the prompt instead of bouncing off the backend's "run already active". The existing working→terminal detection in the thread:updated subscriber delivers it. Queueing twice appends (first\n\nsecond) rather than replacing, so a second thought never silently drops the first. Delivery happens on any terminal including stopped — interrupt-then-redirect is the reason you type mid-run; Cancel is there when you want the queued text gone instead.
  • The queue lives at the useCoder level, not in ThreadView/Composer, so it still fires for a thread you have switched away from.
  • src/components/Composer.tsx — new busy prop. The prompt, attachments, @-mentions and Send stay live while a run is active; locked = disabled || busy keeps the things that cannot be queued (Build, Best of N, model, permission mode) gated as before. disabled now means only "archived", which keeps the old hard lock.
  • ThreadView / App — passes busy={isWorking}, hints the placeholder with "Queue the next instruction…", and renders a muted "Queued …" strip with a Cancel button under the working status strip.

Known ceiling

The queue is renderer-side and in-memory, so a reload mid-run drops it (marked with a ponytail: comment). Move it into the thread record if it needs to survive a restart.

Tests

  • New test/queuedFollowup.test.tsx drives the real App over the fake IPC surface: type-ahead mid-run, delivery exactly once on the terminal push, append-on-second-queue, and cancel (never runs).

  • test/composer.test.tsx updated: the old "run is active" block now covers archived threads; a new block covers busy (prompt live, Send queues, Build/model still locked).

  • Full renderer suite green (691 tests), npm run typecheck clean.

  • PR created by the Claude Code agent

The composer was hard-disabled while a thread was working, so the next
instruction had to wait on the spinner. Now the prompt stays live: a send
during a run is held in useCoder and delivered on that thread's run
terminal, including "stopped" (interrupt-then-redirect is the point of
typing mid-run). Queueing twice appends rather than replacing, so a second
thought never silently drops the first.

The queue lives at the useCoder level, not in ThreadView/Composer, so it
still fires for a thread the user has switched away from. Only what cannot
be queued — Build, Best of N, model, permission mode — stays locked while
busy; archived threads keep the old hard lock.

Co-Authored-By: Claude Opus 5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit fe54cd9 into main Aug 16, 2026
1 check passed
@currentbits
currentbits deleted the coder/composer-is-hard-disabled-during-runs-al-389f73 branch October 3, 2026 16:07
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.

Composer is hard-disabled during runs — allow type-ahead / queue next message

1 participant