Skip to content

Commit 83d476e

Browse files
committed
MCP explain_stats: stop offering -resume after a budget ran out (#320)
A run that ends on -max-queries or -max-duration writes no resume state (only an interrupted run saves one), so the advice now says to raise the budget and run the scan again. TestE2EMCPExplainStats asserts the text.
1 parent d0c56f0 commit 83d476e

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎main_mcp.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,9 @@ func explainTarget(p func(string, ...any), t output.TargetSummary) {
846846
if t.StoppedBy == "duration" {
847847
budget = "-max-duration"
848848
}
849-
p(" %d names were not tested because %s ran out; raise it, or continue with -resume.", t.SkippedCap, budget)
849+
// No resume state is written for a run that ends on a budget (only an
850+
// interrupted run saves one), so -resume is not offered here (#320).
851+
p(" %d names were not tested because %s ran out; raise it and run the scan again.", t.SkippedCap, budget)
850852
}
851853
if t.Wildcard {
852854
p(" The domain answers every name (a wildcard), so subenum dropped %d answers matching the wildcard; a real name that answers the same way is dropped too.", o.WildcardFiltered)

‎main_mcp_test.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,10 @@ func TestE2EMCPExplainStats(t *testing.T) {
612612
t.Errorf("call %d: %q lacks %q (isError %v)", i, text, want, isErr)
613613
}
614614
}
615+
// A capped run writes no resume state, so the advice must not offer -resume (#320).
616+
if text, _ := toolText(t, replies[i]); !strings.Contains(text, "raise it and run the scan again") || strings.Contains(text, "-resume") {
617+
t.Errorf("call %d: capped-run advice should only say to raise the budget and rerun: %q", i, text)
618+
}
615619
}
616620
if text, isErr := toolText(t, replies[2]); !isErr || !strings.Contains(text, "not a subenum run-quality report") {
617621
t.Errorf("non-summary input: %q (isError %v)", text, isErr)

0 commit comments

Comments
 (0)