Skip to content

chat: an immediate Send is pasted over a draft in Claude Code's input box (herdr agent.prompt path) #629

Closed

Description

@devswha

Follow-up to #609 (fixed for queued messages by #628).

What happens

An immediate chat Send to an idle agent does not go through the bridge's pending-message delivery. submitText in server/index.ts hands the text to herdr's agent.prompt, which pastes it into the agent's input box and presses Enter 300 ms later. Nothing checks the box first. If the user left a draft in the terminal's input box (or Claude Code is in bash mode, !), the chat text joins that draft and the Enter sends both as one message, or runs the result as a shell command in bash mode.

#628 adds claudeInputDraft() (server/prompt.ts) and refuses a queued delivery with input_draft while the box is not empty. The immediate path was left out because the paste and the Enter happen inside herdr's agent.prompt.

Options

  1. Run the same check in submitText before agentPrompt for a Claude pane, and refuse with input_draft (the composer keeps the text, the client already treats the code as "nothing typed" after fix(chat): hold a queued message rather than paste it over a Claude draft #628). A race remains between the check and herdr's paste, as it does for the queued path.
  2. Ask herdr for an agent.prompt option that refuses when the input box is not empty, where the check and the paste cannot race.

Option 1 is small and matches #628; option 2 needs herdr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions