Skip to content

fix(panes): avoid injecting prompt twice for literal agent commands - #242

Merged
raine merged 1 commit into
raine:mainfrom
danielroe:fix/double-prompt-injection
Aug 21, 2026
Merged

fix(panes): avoid injecting prompt twice for literal agent commands#242
raine merged 1 commit into
raine:mainfrom
danielroe:fix/double-prompt-injection

Conversation

@danielroe

Copy link
Copy Markdown
Contributor

I encountered an edge case where a prompt was being sent twice.

with agent: pi and panes: [{ command: pi, focus: true }], workmux add dup-probe -b -P PROMPT.md sends this to the pane:

sh -c ' pi "$(cat .workmux/PROMPT-dup-probe.md)" "$(cat .workmux/PROMPT-dup-probe.md)"'

the agent submits the first copy at startup and queues the second. using command: <agent> instead of the literal name doesn't reproduce (and is how I'm working around this locally for the moment).

I think this is because resolve_pane_command_with_config ends with resolved.command = resolved.render_command(), and then render_raw_command() reads self.command back. for a literal agent name, that string already contains the prompt.

this PR keeps the pre-prompt command in a private base_command field, but you may well (likely!) have another better solution 🙏

@raine

raine commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Looks good, thanks!

@raine
raine merged commit 2569e86 into raine:main Aug 21, 2026
3 checks passed
@danielroe
danielroe deleted the fix/double-prompt-injection branch August 21, 2026 14:29
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.

2 participants