Skip to content

fix(tui): show scan failure reason - #906

Open
ousamabenyounes wants to merge 1 commit into
usestrix:mainfrom
ousamabenyounes:fix/issue-810-tui-failure-reason
Open

fix(tui): show scan failure reason#906
ousamabenyounes wants to merge 1 commit into
usestrix:mainfrom
ousamabenyounes:fix/issue-810-tui-failure-reason

Conversation

@ousamabenyounes

Copy link
Copy Markdown
Contributor

Summary

  • Surface scan-level exceptions inside the TUI instead of only re-raising after the user exits.
  • Record a synthetic failed Scan entry with a chat message carrying the real failure reason.
  • Guard the message so the UI refresh loop only records it once.

Fixes #810

Test verification (RED → GREEN)

RED, test-only on upstream main:

$ uv run pytest tests/test_tui_scan_failure.py -q
F [100%]
AttributeError: 'StrixTUIApp' object has no attribute '_record_scan_error_if_needed'
1 failed in 4.87s

GREEN, after fix:

$ uv run pytest tests/test_tui_scan_failure.py -q
. [100%]
1 passed in 5.04s

Focused validation:

$ uv run pytest tests/test_tui_scan_failure.py tests/test_proxy_renderer.py -q
4 passed in 4.38s

$ uv run ruff check strix/interface/tui/app.py strix/interface/tui/live_view.py tests/test_tui_scan_failure.py
All checks passed!

$ uv run ruff format --check strix/interface/tui/app.py strix/interface/tui/live_view.py tests/test_tui_scan_failure.py
3 files already formatted

$ uv run mypy strix/interface/tui/live_view.py
Success: no issues found in 1 source file

$ uv run bandit -q -c pyproject.toml strix/interface/tui/live_view.py
exit 0

Known baseline: repository-wide mypy on strix/interface/tui/app.py has existing Textual typing errors unrelated to this patch.

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Surface scan-level exceptions in the TUI.

  • Add a synthetic failed “Scan” entry containing the underlying exception and recovery guidance.
  • Select the synthetic entry automatically when no agent is selected and prevent duplicate error events.
  • Add focused coverage confirming the failure is recorded exactly once.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The new failure entry uses an agent ID distinct from generated runtime agent IDs, preserves the original exception text, and is guarded against duplicate events.

Important Files Changed

Filename Overview
strix/interface/tui/app.py Records a pending scan exception during UI refresh, selects the synthetic failure entry when appropriate, and guards against duplicate recording.
strix/interface/tui/live_view.py Adds the synthetic scan-failure agent and its user-visible chat event.
tests/test_tui_scan_failure.py Verifies the scan failure’s status, message, selection behavior, and one-time recording.

Reviews (1): Last reviewed commit: "fix(tui): show scan failure reason" | Re-trigger Greptile

@ousamabenyounes
ousamabenyounes force-pushed the fix/issue-810-tui-failure-reason branch from 03cd771 to cc6276b Compare July 27, 2026 20:36
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.

[FEATURE]Add output of scan failure reasons.

1 participant