diff --git a/pkg/agent/core.go b/pkg/agent/core.go index 65901ba..1eaf6df 100644 --- a/pkg/agent/core.go +++ b/pkg/agent/core.go @@ -137,6 +137,8 @@ func expandSystemPrompt(content, cwd string) string { } mapper := func(key string) string { switch key { + case "PWD": + return cwd case "PRIME_DATE": return time.Now().Format("2006-01-02") case "PRIME_PLATFORM": diff --git a/pkg/agent/core_test.go b/pkg/agent/core_test.go index bac5847..bd9555c 100644 --- a/pkg/agent/core_test.go +++ b/pkg/agent/core_test.go @@ -544,6 +544,14 @@ func TestExpandSystemPrompt_IsGitFalse(t *testing.T) { } } +func TestExpandSystemPrompt_PWDUsesCWD(t *testing.T) { + dir := t.TempDir() + got := expandSystemPrompt("${PWD}", dir) + if got != dir { + t.Errorf("got %q; want %q", got, dir) + } +} + // --- BuildAgentEnv: missing system prompt --- func TestBuildAgentEnv_MissingSystemPrompt(t *testing.T) {