Skip to content

MCP explain_stats: stop offering -resume after a budget ran out - #335

Merged
TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
O1sumitkumar:fix/explain-stats-no-resume-advice
Nov 15, 2026
Merged

TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
O1sumitkumar:fix/explain-stats-no-resume-advice

Conversation

@O1sumitkumar

Copy link
Copy Markdown
Contributor

Description

The MCP explain_stats tool told the agent to "continue with -resume" when a target had candidates skipped by -max-queries / -max-duration. A budget-limited run exits normally and writes no resume state (only an interrupted run calls saveResumeState), so that next step fails. The sentence now names only the step that works: raise the budget and run the scan again.

TestE2EMCPExplainStats (which already runs a simulated -max-queries scan) now asserts the advice says "raise it and run the scan again" and does not mention -resume.

Related Issue

Fixes #320

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvements
  • Test updates

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • I have added/updated appropriate comments to the code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable) — no docs repeat this sentence (rg "continue with -resume" finds nothing else)

Ethical Considerations

  • This change maintains or improves the security controls in the tool
  • This change follows the educational/legitimate security testing focus of the project
  • I have considered potential misuse cases and taken appropriate steps to prevent them

Additional Information

Verified locally with Go 1.27.3:

  • With only the test change applied, go test -run TestE2EMCPExplainStats . fails on both calls ("...raise it, or continue with -resume.").
  • With the fix: go test -race -run TestE2EMCPExplainStats . passes, go vet . is clean, and go test ./... passes. I did not run make lint (golangci-lint is not installed here).

If continuing a capped run is added later (the related enhancement), the sentence can mention -resume again.

…Digital#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.
@TMHSDigital
TMHSDigital merged commit 8c57cdf into TMHSDigital:main Nov 15, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

explain_stats advises "continue with -resume" after a budget ran out

2 participants