From 5865a01e48cba1d6fa51c4fac415cc136c1ae4d7 Mon Sep 17 00:00:00 2001 From: Parth Sareen Date: Thu, 16 Jul 2026 19:05:30 -0700 Subject: [PATCH] agent: reorder working directory instruction (#17228) --- cmd/agent_tui.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/agent_tui.go b/cmd/agent_tui.go index 4cf4a5ded..6d370d15b 100644 --- a/cmd/agent_tui.go +++ b/cmd/agent_tui.go @@ -359,9 +359,6 @@ func agentDefaultSystemPromptWithWorkingDir(now time.Time, modelName string, wor "Current date: " + date + ".", "", } - if workingDir != "" { - parts = append(parts, "Current working directory: "+strconv.Quote(workingDir)+".", "") - } parts = append(parts, "Be concise, practical, and action-oriented. Use tools when they materially help. Verify current or fast-changing facts with web tools when available; otherwise state uncertainty.", "", @@ -369,6 +366,9 @@ func agentDefaultSystemPromptWithWorkingDir(now time.Time, modelName string, wor "", "Tell the user about meaningful changes, verification, failures, blockers, assumptions, and risks. Summarize routine tool output instead of dumping it.", ) + if workingDir != "" { + parts = append(parts, "Current working directory: "+strconv.Quote(workingDir)+".") + } return strings.Join(parts, "\n") }