strix icon indicating copy to clipboard operation
strix copied to clipboard

[BUG] Report generated during scan but not saved on exit (no .md file, exit with vulnerabilities to 0)

Open JNX03 opened this issue 10 months ago • 7 comments

When running Strix, it appears to successfully generate a vulnerability report during execution (shows “Creating report…”). However, after exiting Strix, the report is not saved to disk. The final result shows 0 vulnerabilities, and no .md report file is created, so the generated report cannot be viewed.

To Reproduce

Steps to reproduce the behavior:

  1. Run Strix normally on a target. Example command used for testing:

    strix --target http://localhost:10010 --instruction "test report (you report an Vulnerabilities as 'INFO' and 'High' with 'Test' for description to make sure you able to report) and done you are job is done"
    
  2. Let the scan complete and wait until it shows “Creating report…”.

  3. Exit Strix.

  4. Check the output directory / project folder for the generated report.

Expected behavior

Strix should save the generated report to disk after the scan finishes. The vulnerability count should persist, and a .md report file should be created so the findings can be reviewed.

Screenshots

Scan shows report being created: scan report

More output during scan: scan output

After exit, vulnerabilities reset to 0 and no report exists: after exit

System Information

  • OS: Windows 11 (run via Git Bash)

  • Strix Version or Commit: 0.7.0

  • Python Version: 3.13.7

  • LLM Used: GLM 4.7

    • Also tested with: gemini-3-pro-preview, gpt-5.2

Additional context

This looks like the report writer does not persist data on exit or does not flush/write the report to disk. It may be related to output path handling or missing save logic. No error is shown, but the report is silently lost.

It feels like the report exists only in memory and is discarded when the process exits.

JNX03 avatar Jan 25 '26 09:01 JNX03

me too。。。。But this kind of situation happens very randomly.

Suhuan-zhen avatar Feb 20 '26 03:02 Suhuan-zhen

Yeah I found out that this happen we the AI model don’t fill up everything so the tools seem to be error

JNX03 avatar Feb 20 '26 14:02 JNX03

@JNX03 could you please share your config for using GLM 4.7 ( STRIX_LLM, LLM_API_BASE)? I can use only free - flash - models with strix. I don't know why and how to fix it

dexion avatar Feb 21 '26 18:02 dexion

@JNX03 could you please share your config for using GLM 4.7 ( STRIX_LLM, LLM_API_BASE)? I can use only free - flash - models with strix. I don't know why and how to fix it

If you use Strix v0.8.0 + Use this

export PATH=$PATH:$HOME/.strix/bin
export STRIX_LLM="zai/glm-5" (Change this to 4.7 if you want)
export LLM_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export LLM_API_BASE="https://api.z.ai/api/coding/paas/v4"
export STRIX_REASONING_EFFORT="xhigh"

If you use Stirx under v0.8.0 Use this

export PATH=$PATH:$HOME/.strix/bin
export STRIX_LLM="openai/glm-4.7" (Change to 5 if you want)
export LLM_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export LLM_API_BASE="https://api.z.ai/api/coding/paas/v4"
export STRIX_REASONING_EFFORT="xhigh"

Note : If you use on windows (command prompt , cmd , powershell) change export to set

JNX03 avatar Feb 22 '26 06:02 JNX03

Hi @0xallam -- I'd like to take on this issue.

I've traced the report persistence flow through the codebase and identified two contributing factors:

1. Missing tracer.cleanup() in main.py's finally block (primary cause)

Both cli.py (L108-122) and tui.py (L762-777) register atexit + signal handlers that call tracer.cleanup(). However, main.py's finally block (L561-576) calls posthog.end() but never calls tracer.cleanup(). On Windows -- where asyncio.WindowsSelectorEventLoopPolicy() is used -- the atexit handlers registered by cli/tui may not fire reliably when the event loop tears down, leaving reports unsaved.

2. Strict validation in finish_actions.py discards partial reports

As @JNX03 noted, this happens "when the AI model doesn't fill up everything." The finish_scan tool requires all 4 fields (executive_summary, methodology, technical_analysis, recommendations) to be non-empty. If any field is missing, it returns an error without saving -- even though vulnerabilities were already saved incrementally via add_vulnerability_report().

Proposed fix:

  1. Add explicit tracer.cleanup() in main.py's finally block before posthog.end() -- ensures report data is persisted regardless of whether atexit handlers fire.
  2. Graceful fallback in finish_actions.py -- save partial reports with a placeholder (e.g., "[Not provided by model]") instead of rejecting the entire report.

Happy to submit a PR if this approach looks good.

mason5052 avatar Feb 22 '26 18:02 mason5052

Hi @0xallam -- following up on my analysis above (Feb 22). The two-part fix I proposed (tracer.cleanup() safety net in main.py + graceful partial report saving in finish_actions.py) should be a focused 2-file change. Happy to submit a PR whenever you're ready. No rush -- just wanted to keep this on the radar since it's affecting multiple users.

mason5052 avatar Mar 06 '26 14:03 mason5052

hey @mason5052 , feel free to submit a PR and we will review ASAP! (plz include a video of it being broken before and working after, thanks)

bearsyankees avatar Apr 22 '26 20:04 bearsyankees