fix(core): compile fallback report if agent misses lifecycle tool call#645
Open
Kundan-Krishna366 wants to merge 2 commits into
Open
fix(core): compile fallback report if agent misses lifecycle tool call#645Kundan-Krishna366 wants to merge 2 commits into
Kundan-Krishna366 wants to merge 2 commits into
Conversation
Contributor
Greptile SummaryThis PR adds a fallback report path when a scan ends without the expected lifecycle tool call.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(core): update fallback report path t..." | Re-trigger Greptile |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running a penetration test with some locally hosted LLMs (for example,
openai/supergemma4-26b-uncensored-v2through LM Studio), the scan may terminate during the final reporting stage with:Environment:
openai/supergemma4-26b-uncensored-v2(LM Studio)Root Cause
Near the end of a scan, large tool outputs can cause some local models to stop following the expected structured response format. Instead of invoking the
finish_scanlifecycle tool, the model returns a plain text response.Since the orchestration logic only considers the lifecycle tool as the completion signal,
scan_completedremainsFalse, causing the report generation phase to be skipped and no report to be written.Changes
strix/core/runner.pywhenscan_completedisFalse.finish_scantool call, the runner:reports/directory if it does not already exist,reports/report_<scan_id>_fallback.md.This ensures that scan findings are preserved even when the model fails to emit the expected lifecycle tool call.
Validation
ruff formatruff checkmypybanditBefore
After
Closes #489