Skip to content

Commit 6cebddd

Browse files
committed
fix: add openCodePromptEnv, fix test, gofumpt
1 parent 9b8e718 commit 6cebddd

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

e2e/agents/opencode.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,7 @@ func (a *openCodeAgent) StartSession(ctx context.Context, dir string) (Session,
166166
}
167167
return nil, fmt.Errorf("opencode TUI failed to start after retry: %w", lastErr)
168168
}
169+
170+
func openCodePromptEnv(base []string, dir string) []string {
171+
return append(filterEnv(base, "TRACE_TEST_TTY", "PWD"), "PWD="+dir)
172+
}

e2e/agents/opencode_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestOpenCodePromptEnv_OverridesPWD(t *testing.T) {
1515
t.Parallel()
1616
base := []string{
1717
"PWD=/some/stale/go-test/dir",
18-
"ENTIRE_TEST_TTY=1",
18+
"TRACE_TEST_TTY=1",
1919
"HOME=/home/runner",
2020
}
2121

@@ -40,9 +40,9 @@ func TestOpenCodePromptEnv_OverridesPWD(t *testing.T) {
4040
t.Fatalf("expected exactly one PWD entry, got %d", count)
4141
}
4242

43-
// ENTIRE_TEST_TTY is still stripped so the agent exercises real TTY detection.
44-
if got, ok := envValue(env, "ENTIRE_TEST_TTY"); ok {
45-
t.Fatalf("ENTIRE_TEST_TTY = %q, want stripped", got)
43+
// TRACE_TEST_TTY is still stripped so the agent exercises real TTY detection.
44+
if got, ok := envValue(env, "TRACE_TEST_TTY"); ok {
45+
t.Fatalf("TRACE_TEST_TTY = %q, want stripped", got)
4646
}
4747

4848
// Unrelated env is preserved.

0 commit comments

Comments
 (0)