From fb0e4b44393bae3c54f099bea87dfea19854d058 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Fri, 13 Mar 2026 05:24:20 +0000 Subject: fix: enable Gemini file writing by passing --yolo and -p flags GeminiRunner.buildArgs was missing --yolo (auto-approve all tools) so the gemini CLI only registered 3 tools (read_file, write_todos, cli_help) and write_file was not available. Agents that needed to create files silently failed (exit 0, no files written). Also switch instructions from bare positional arg to -p flag, which is required for non-interactive headless mode. Update preamble tests to match file-based summary approach (CLAUDOMATOR_SUMMARY_FILE) kept from the merge conflict resolution. Co-Authored-By: Claude Sonnet 4.6 --- internal/executor/preamble_test.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'internal/executor/preamble_test.go') diff --git a/internal/executor/preamble_test.go b/internal/executor/preamble_test.go index 448ad3a..984f786 100644 --- a/internal/executor/preamble_test.go +++ b/internal/executor/preamble_test.go @@ -11,16 +11,14 @@ func TestPlanningPreamble_ContainsFinalSummarySection(t *testing.T) { } } -func TestPlanningPreamble_SummaryRequiresMarkdownHeader(t *testing.T) { - if !strings.Contains(planningPreamble, `Start it with "## Summary"`) { - t.Error("planningPreamble does not instruct agent to start summary with '## Summary'") +func TestPlanningPreamble_SummaryUsesFileEnvVar(t *testing.T) { + if !strings.Contains(planningPreamble, "CLAUDOMATOR_SUMMARY_FILE") { + t.Error("planningPreamble should instruct agent to write summary to $CLAUDOMATOR_SUMMARY_FILE") } } -func TestPlanningPreamble_SummaryDescribesRequiredContent(t *testing.T) { - for _, phrase := range []string{"What was accomplished", "Key decisions made", "Any issues or follow-ups"} { - if !strings.Contains(planningPreamble, phrase) { - t.Errorf("planningPreamble missing required summary content description: %q", phrase) - } +func TestPlanningPreamble_SummaryInstructsEchoToFile(t *testing.T) { + if !strings.Contains(planningPreamble, `"$CLAUDOMATOR_SUMMARY_FILE"`) { + t.Error("planningPreamble should show example of writing to $CLAUDOMATOR_SUMMARY_FILE via echo") } } -- cgit v1.2.3