diff --git a/cmd/harness/main.go b/cmd/harness/main.go index 18d91f8..02d943d 100644 --- a/cmd/harness/main.go +++ b/cmd/harness/main.go @@ -1995,7 +1995,7 @@ func baseBehaviorGuidance() string { "Persist until the task is fully resolved end to end. Do not stop at analysis or a partial fix, and do not leave a follow-up for later.", "Fix the root cause, not a surface patch. Do not fix an unrelated bug; mention it instead. Keep the diff minimal and consistent with the existing style.", "Be bold on a greenfield task. Stay surgical on an existing codebase: do exactly what was asked, and do not rename or restructure something you were not asked to touch.", - "Keep your final message short. Reference a file path instead of pasting a file you just wrote, and lead with the outcome.", + "Be concise, direct, and friendly, keeping the user informed without unnecessary detail. Brevity matters by default: no more than 10 lines, relaxed where detail is important for the user's understanding, or where correctness, security, or review findings require it. Lead with the outcome, assumptions, and next steps. Reference a file path instead of pasting a file you just wrote. Do not repeat tool output.", "Before a long silent stretch of tool calls, send a brief note on what you are about to do and why.", "If asked for a review, lead with the findings -- bugs, risks, missing tests -- ordered by severity, before any summary.", "For a frontend task, avoid a generic templated look. Choose type, color, and layout that fit the product instead of a default-looking page.", diff --git a/cmd/harness/main_test.go b/cmd/harness/main_test.go index c5c7d04..8773a9a 100644 --- a/cmd/harness/main_test.go +++ b/cmd/harness/main_test.go @@ -1203,6 +1203,33 @@ func TestSystemPromptCarriesBaseBehaviorGuidance(t *testing.T) { } } +// Input: a session with no project instructions. Wrong output: the base +// prompt asks only for a "short" final message, so user-visible answer length +// falls back to model default. +func TestBaseBehaviorGuidanceSetsAnAdaptiveBrevityDefault(t *testing.T) { + got := baseBehaviorGuidance() + + for _, want := range []string{ + "concise, direct, and friendly", + "10 lines", + } { + if !strings.Contains(got, want) { + t.Errorf("base behavior guidance missing %q:\n%s", want, got) + } + } + if !strings.Contains(got, "relax") { + t.Errorf("brevity ceiling has no stated exception, so it reads as an absolute cap:\n%s", got) + } + for _, unwanted := range []string{"4 lines", "four lines", "one-word", "single word"} { + if strings.Contains(got, unwanted) { + t.Errorf("base behavior guidance carries a second, tighter brevity cap %q:\n%s", unwanted, got) + } + } + if !strings.Contains(got, "file path") { + t.Errorf("base behavior guidance lost the reference-a-path-instead-of-pasting rule:\n%s", got) + } +} + // TestBaseBehaviorGuidanceStaysUnderBudget pins the line/word ceiling Andy set // for the addition ("the prose is minimal and not too crazy long") so a later // clause-by-clause addition cannot silently balloon it back into a