Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
When the agent is mid-task (executing a chain of tool calls), users can queue messages — but those messages wait until the entire task completes before the agent sees them. There's no way to inject context or corrections into the agent's current work without interrupting it.
Current behavior:
- Agent is mid-task (e.g., 10 tool calls into a refactor)
- User realizes the tests live in
__tests__/nottest/ - User types a correction → message is queued
- Agent finishes the entire task (possibly doing it wrong) → then sees the correction as a new turn
Desired behavior:
- Agent is mid-task
- User types
/btw the tests are in __tests__/ not test/ - Agent sees the message between tool calls during the current task
- Agent adjusts mid-flight without stopping or restarting
Proposed Solution
Add a /btw command (or equivalent mechanism) that injects a user message into the agent's current agentic loop between tool call iterations, rather than queueing it for after task completion.
How it would work
- User types
/btw <message>while agent is working - Message is placed in a priority queue (separate from normal message queue)
- In the main loop (
prompt.ts), between loop iterations (after a tool call completes, before the next LLM call), check for pending/btwmessages - Inject as a user message in the conversation context before the next LLM call
- Agent sees the context and incorporates it — continues its current task, doesn't treat it as a new instruction
Key design points
- Non-interrupting: Agent doesn't stop or restart — it folds the info into its next iteration
- Lightweight: No new session, no subagent, no task management — just a message injection
- Distinct from queued messages: Queued messages start a new turn after task completion;
/btwmessages augment the current turn
Use Cases
Course correction: "btw use the existing formatDate util instead of writing a new one"
Missing context: "btw that file moved to src/v2/ last week"
Preference: "btw don't add comments to the functions, just the module header"
Heads up: "btw I'm going to need the same change in the mobile app too, keep it portable"
Prior Art
- Claude Code recently shipped
/btwwith exactly this behavior - Claude Code issue #29224 — side-channel responses for queued messages
- Claude Code issue #30492 — priority message channel for mid-execution steering
Related Issues
- [FEATURE]: Graceful handling of queued messages after session interrupt #5333 — Graceful handling of queued messages after interrupt (related but different: deals with queue persistence after abort, not mid-task injection)
- Feature Request: Async Task Management - Non-blocking Subagent Dispatch #15069 — Async task management / non-blocking subagent dispatch (much larger scope: full async task system;
/btwis a simpler, targeted feature) - [feat] True Async/Background Sub-Agent Delegation #5887 — True async/background sub-agent delegation (related but different axis: background tasks vs. mid-task context injection)
Implementation Notes
The agentic loop in prompt.ts already iterates between tool calls. The injection point is natural — check a priority queue between iterations. The TUI already accepts input during agent execution. The delta is routing /btw-prefixed input to a priority queue instead of the normal message queue, and having the loop check it.
Activity
github-actions commentedon Mar 16, 2026
This issue might be a duplicate of existing issues. Please check:
prompt.tsIf you believe your request is distinct from the above, please clarify how it differs.
oleborne commentedon Mar 16, 2026
Also a duplicate of #16992
github-actions commentedon Jul 7, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.