Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/harness/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
27 changes: 27 additions & 0 deletions cmd/harness/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down