Skip to content

Feature: Mid-stream context injection at natural breaks (like Claude Code) #5122

@sudoxnym

Description

@sudoxnym

Feature Request

Current Behavior

When typing while the AI is responding, messages are queued and only processed after the current response completes. This means if I remember something important mid-response, I have to wait for completion or cancel entirely.

Desired Behavior

Allow queued user input to be injected at natural breaks during response generation, similar to how Claude Code handles this:

  1. User types new input while AI is responding
  2. System detects a "natural break" (after tool result, end of text block, between reasoning steps)
  3. User's new input is appended to the conversation context
  4. AI continues but now sees the new info and can incorporate it

Why This Matters

  • Sometimes you forget context and remember mid-response
  • Canceling loses progress and costs tokens
  • Current queue waits until completion, missing the chance to influence the current response

Implementation Notes

The agent loop would need to:

  1. Check for pending queued input at safe breakpoints (after tool calls complete, after text blocks)
  2. If input exists, append it to the conversation before continuing
  3. Let the model naturally incorporate the new context in its next step

This is different from interrupt (which breaks tool_use/tool_result pairing) - it's a graceful context merge at safe points.

Reference

Claude Code does this - you can type mid-response and it finds a natural break to pop in your new message before continuing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions