From 74b6f0b99ccffb3567961346e17024132bbcc05b Mon Sep 17 00:00:00 2001 From: toki Date: Sat, 15 Aug 2026 15:51:55 +0900 Subject: [PATCH] =?UTF-8?q?fix(openai):=20Claude=20Code=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=20=EA=B2=BD=EB=A1=9C=20=ED=98=95=EC=8B=9D=EC=9D=84=20?= =?UTF-8?q?=EC=A0=95=EA=B7=9C=ED=99=94=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/edge/internal/openai/hot_path_light_test.go | 11 +++++++++++ apps/edge/internal/openai/hot_path_stage_input.go | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/edge/internal/openai/hot_path_light_test.go b/apps/edge/internal/openai/hot_path_light_test.go index 5050e611..7a575af4 100644 --- a/apps/edge/internal/openai/hot_path_light_test.go +++ b/apps/edge/internal/openai/hot_path_light_test.go @@ -330,6 +330,17 @@ func TestHotPathStageInputIsolation(t *testing.T) { } } +func TestCallerWorkingDirectoryFromClaudeCodeSystemPrompt(t *testing.T) { + task := "system: runtime context\n- Primary working directory: /workspace/claude-run\nuser: create index.html" + got, err := callerWorkingDirectory(task) + if err != nil { + t.Fatal(err) + } + if want := "/workspace/claude-run"; got != want { + t.Fatalf("caller working directory = %q, want %q", got, want) + } +} + type scriptedLightPoolService struct { providerFakeRunService mu sync.Mutex diff --git a/apps/edge/internal/openai/hot_path_stage_input.go b/apps/edge/internal/openai/hot_path_stage_input.go index c20acf49..653506c3 100644 --- a/apps/edge/internal/openai/hot_path_stage_input.go +++ b/apps/edge/internal/openai/hot_path_stage_input.go @@ -178,7 +178,7 @@ func callerWorkingDirectory(task string) (string, error) { break } } - for _, prefix := range []string{"Working directory:", "Current working directory:"} { + for _, prefix := range []string{"Working directory:", "Current working directory:", "- Primary working directory:"} { if !strings.HasPrefix(line, prefix) { continue }