Compare commits

...

1 Commits

Author SHA1 Message Date
Jiang Bohan
d7a4c3a1aa feat(agent): log full command line at debug level when spawning agents
Add a debug-level log line in every agent backend (claude, codex,
opencode, openclaw, gemini, hermes) that prints the executable path
and full argument list when spawning the agent process. Helps diagnose
custom args, model overrides, and other CLI flag issues.
2026-04-15 16:20:12 +08:00
6 changed files with 6 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ func (b *claudeBackend) Execute(ctx context.Context, prompt string, opts ExecOpt
args := buildClaudeArgs(opts, b.cfg.Logger)
cmd := exec.CommandContext(runCtx, execPath, args...)
b.cfg.Logger.Debug("agent command", "exec", execPath, "args", args)
cmd.WaitDelay = 10 * time.Second
if opts.Cwd != "" {
cmd.Dir = opts.Cwd

View File

@@ -42,6 +42,7 @@ func (b *codexBackend) Execute(ctx context.Context, prompt string, opts ExecOpti
codexArgs := append([]string{"app-server", "--listen", "stdio://"}, filterCustomArgs(opts.CustomArgs, codexBlockedArgs, b.cfg.Logger)...)
cmd := exec.CommandContext(runCtx, execPath, codexArgs...)
b.cfg.Logger.Debug("agent command", "exec", execPath, "args", codexArgs)
if opts.Cwd != "" {
cmd.Dir = opts.Cwd
}

View File

@@ -35,6 +35,7 @@ func (b *geminiBackend) Execute(ctx context.Context, prompt string, opts ExecOpt
args := buildGeminiArgs(prompt, opts, b.cfg.Logger)
cmd := exec.CommandContext(runCtx, execPath, args...)
b.cfg.Logger.Debug("agent command", "exec", execPath, "args", args)
cmd.WaitDelay = 10 * time.Second
if opts.Cwd != "" {
cmd.Dir = opts.Cwd

View File

@@ -36,6 +36,7 @@ func (b *hermesBackend) Execute(ctx context.Context, prompt string, opts ExecOpt
hermesArgs := append([]string{"acp"}, opts.CustomArgs...)
cmd := exec.CommandContext(runCtx, execPath, hermesArgs...)
b.cfg.Logger.Debug("agent command", "exec", execPath, "args", hermesArgs)
if opts.Cwd != "" {
cmd.Dir = opts.Cwd
}

View File

@@ -60,6 +60,7 @@ func (b *openclawBackend) Execute(ctx context.Context, prompt string, opts ExecO
args = append(args, "--message", prompt)
cmd := exec.CommandContext(runCtx, execPath, args...)
b.cfg.Logger.Debug("agent command", "exec", execPath, "args", args)
cmd.WaitDelay = 10 * time.Second
if opts.Cwd != "" {
cmd.Dir = opts.Cwd

View File

@@ -55,6 +55,7 @@ func (b *opencodeBackend) Execute(ctx context.Context, prompt string, opts ExecO
args = append(args, prompt)
cmd := exec.CommandContext(runCtx, execPath, args...)
b.cfg.Logger.Debug("agent command", "exec", execPath, "args", args)
cmd.WaitDelay = 10 * time.Second
if opts.Cwd != "" {
cmd.Dir = opts.Cwd