fix(codeagent-wrapper): remove extraneous dash arg for opencode stdin mode (#124)

opencode does not support "-" as a stdin marker like codex/claude/gemini.
When using stdin mode, omit the "-" argument so opencode reads from stdin
without an unrecognized positional argument.

Closes #124

Generated with SWE-Agent.ai

Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
This commit is contained in:
cexll
2026-01-16 10:30:38 +08:00
parent 0986fa82ee
commit 238c7b9a13
2 changed files with 13 additions and 1 deletions

View File

@@ -204,7 +204,10 @@ func (OpencodeBackend) BuildArgs(cfg *Config, targetArg string) []string {
if cfg.Mode == "resume" && cfg.SessionID != "" {
args = append(args, "-s", cfg.SessionID)
}
args = append(args, "--format", "json", targetArg)
args = append(args, "--format", "json")
if targetArg != "-" {
args = append(args, targetArg)
}
return args
}