Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions internal/plugins/workspace/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,22 +498,22 @@ fi
// aider uses --message flag
script = fmt.Sprintf(`#!/bin/bash
%s
%s --message "$(cat <<'SIDECAR_PROMPT_EOF'
read -r -d '' sidecar_prompt <<'SIDECAR_PROMPT_EOF'
%s
SIDECAR_PROMPT_EOF
)"
%s --message "$sidecar_prompt"
rm -f %q
`, shellSetup, baseCmd, prompt, launcherFile)
`, shellSetup, prompt, baseCmd, launcherFile)
case AgentOpenCode:
// opencode uses 'run' subcommand
script = fmt.Sprintf(`#!/bin/bash
%s
%s run "$(cat <<'SIDECAR_PROMPT_EOF'
read -r -d '' sidecar_prompt <<'SIDECAR_PROMPT_EOF'
%s
SIDECAR_PROMPT_EOF
)"
%s run "$sidecar_prompt"
rm -f %q
`, shellSetup, baseCmd, prompt, launcherFile)
`, shellSetup, prompt, baseCmd, launcherFile)
case AgentAmp:
// amp requires piping via stdin, does not accept positional args
script = fmt.Sprintf(`#!/bin/bash
Expand All @@ -527,12 +527,12 @@ rm -f %q
// Most agents (claude, codex, gemini, cursor) take prompt as positional argument
script = fmt.Sprintf(`#!/bin/bash
%s
%s "$(cat <<'SIDECAR_PROMPT_EOF'
read -r -d '' sidecar_prompt <<'SIDECAR_PROMPT_EOF'
%s
SIDECAR_PROMPT_EOF
)"
%s "$sidecar_prompt"
rm -f %q
`, shellSetup, baseCmd, prompt, launcherFile)
`, shellSetup, prompt, baseCmd, launcherFile)
}

if err := os.WriteFile(launcherFile, []byte(script), 0700); err != nil {
Expand Down