From 5ad4120968ed67fdb10f2bdac807d238689f4c3f Mon Sep 17 00:00:00 2001 From: Jiayuan Zhang Date: Tue, 7 Apr 2026 23:51:52 +0800 Subject: [PATCH] fix: add debug logging for agentflow prompt injection in daemon Log whether the agentflow context was set and whether the agentflow prompt is being used. Helps diagnose cases where the daemon binary doesn't have the latest agentflow code. Co-Authored-By: Claude Opus 4.6 (1M context) --- server/internal/daemon/daemon.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/internal/daemon/daemon.go b/server/internal/daemon/daemon.go index 09c75b7a8..5884aea86 100644 --- a/server/internal/daemon/daemon.go +++ b/server/internal/daemon/daemon.go @@ -881,6 +881,9 @@ func (d *Daemon) runTask(ctx context.Context, task Task, provider string, taskLo } if task.Agentflow != nil { taskCtx.AgentflowPrompt = task.Agentflow.Description + taskLog.Info("agentflow context set", "prompt_len", len(task.Agentflow.Description), "title", task.Agentflow.Title) + } else if task.AgentflowRunID != "" { + taskLog.Warn("agentflow run ID set but no agentflow data received from server", "agentflow_run_id", task.AgentflowRunID) } // Try to reuse the workdir from a previous task on the same (agent, issue) pair. @@ -914,6 +917,7 @@ func (d *Daemon) runTask(ctx context.Context, task Task, provider string, taskLo var prompt string if task.AgentflowRunID != "" { prompt = BuildAgentflowPrompt(task) + taskLog.Info("using agentflow prompt", "agentflow_run_id", task.AgentflowRunID, "has_agentflow", task.Agentflow != nil) } else { prompt = BuildPrompt(task) }