Compare commits

...

1 Commits

Author SHA1 Message Date
Jiang Bohan
4e049e258f feat(daemon): log agent invocation at info level
Surface the actual exec path + argv for every agent backend at INFO
so operators can see the exact command without flipping to debug.
Also add the missing log line in pi.go for consistency with the
other nine backends.
2026-04-21 14:28:56 +08:00
10 changed files with 10 additions and 9 deletions

View File

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

View File

@@ -100,7 +100,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)
b.cfg.Logger.Info("agent command", "exec", execPath, "args", codexArgs)
if opts.Cwd != "" {
cmd.Dir = opts.Cwd
}

View File

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

View File

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

View File

@@ -35,7 +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)
b.cfg.Logger.Info("agent command", "exec", execPath, "args", args)
cmd.WaitDelay = 10 * time.Second
if opts.Cwd != "" {
cmd.Dir = opts.Cwd

View File

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

View File

@@ -51,7 +51,7 @@ func (b *kimiBackend) Execute(ctx context.Context, prompt string, opts ExecOptio
// "approve_for_session" to every session/request_permission request.
kimiArgs := append([]string{"acp"}, filterCustomArgs(opts.CustomArgs, kimiBlockedArgs, b.cfg.Logger)...)
cmd := exec.CommandContext(runCtx, execPath, kimiArgs...)
b.cfg.Logger.Debug("agent command", "exec", execPath, "args", kimiArgs)
b.cfg.Logger.Info("agent command", "exec", execPath, "args", kimiArgs)
if opts.Cwd != "" {
cmd.Dir = opts.Cwd
}

View File

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

View File

@@ -55,7 +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)
b.cfg.Logger.Info("agent command", "exec", execPath, "args", args)
cmd.WaitDelay = 10 * time.Second
if opts.Cwd != "" {
cmd.Dir = opts.Cwd

View File

@@ -54,6 +54,7 @@ func (b *piBackend) Execute(ctx context.Context, prompt string, opts ExecOptions
args := buildPiArgs(prompt, sessionPath, opts, b.cfg.Logger)
cmd := exec.CommandContext(runCtx, execPath, args...)
b.cfg.Logger.Info("agent command", "exec", execPath, "args", args)
cmd.WaitDelay = 10 * time.Second
if opts.Cwd != "" {
cmd.Dir = opts.Cwd