revert: remove post-iteration system prompt rebuild

Show the actual prompt sent to the LLM (messages[0].Content), not a
rebuilt version. The pre-iteration capture is the ground truth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
dj-oyu 2026-02-24 18:24:46 +09:00
parent e824ce8945
commit 4f0384212d

View file

@ -926,13 +926,6 @@ func (al *AgentLoop) runAgentLoop(ctx context.Context, agent *AgentInstance, opt
return "", err
}
// 5-post. Refresh cached system prompt: tool execution may have updated touch_dir,
// so rebuild with current workDir so Mini App shows the up-to-date version.
if active := al.sessions.ListActive(); len(active) > 0 && active[0].SessionKey == opts.SessionKey && active[0].TouchDir != "" {
agent.ContextBuilder.SetWorkDir(filepath.Join(agent.Workspace, active[0].TouchDir))
}
al.lastSystemPrompt.Store(agent.ContextBuilder.BuildSystemPrompt())
// 5a. Auto-advance plan phases after LLM iteration
postStatus := agent.ContextBuilder.GetPlanStatus()
if agent.ContextBuilder.HasActivePlan() && (postStatus == "executing" || postStatus == "review" || postStatus == "completed") {