fix(strix): sanitize benign MODEL QUALITY WARNING banner before infra-failure detection - #1311
fix(strix): sanitize benign MODEL QUALITY WARNING banner before infra-failure detection#1311seonghobae wants to merge 1 commit into
Conversation
…before infra-failure detection Strix prints a box-drawn "MODEL QUALITY WARNING" banner at startup whenever the configured model is not on its own hardcoded list of recommended frontier models -- a static disclaimer about model choice, unrelated to the scan's actual outcome. The banner's literal "WARNING" text satisfies has_detected_infrastructure_error()'s generic Fatal/Denied/Warn/Warning substring matcher (and, when Strix persists its own console transcript as a report artifact, the equivalent has_strix_report_failure_signal() matcher too), so any clean, 0-vulnerability scan on the org's configured default model (nvidia_nim/nvidia/nemotron-3-super-120b-a12b, which is not on Strix's recommended list) is misclassified as a provider infrastructure failure and fails closed even though the scan itself succeeded (rc=0) with zero findings. Reproduced directly from a real PR run: TEPP#214's "strix" required check failed with "Strix run emitted provider infrastructure or failure-signal output; failing closed." while its own captured transcript shows a complete penetration test summary reporting "Low" risk posture and "Vulnerabilities 0". The same banner text (6 occurrences across fallback attempts) appears in fast-mlsirm PR #1237's strix job log, suggesting this contributes to the org-wide "zero PRs mergeable" pattern tracked in #1212. Fix: strip the banner (matched structurally by its box-drawing delimiters plus the "MODEL QUALITY WARNING" marker line, so it does not depend on the exact recommended-model list or wrapped text) from $STRIX_LOG before has_detected_infrastructure_error() runs, and from report .log files inside sanitize_known_strix_report_warnings() before has_strix_report_failure_signal() runs -- mirroring the existing, narrowly-scoped sanitization already used for Strix's other known benign internal warning. This does not touch vulnerability-severity classification (reported_vulnerability_signal, has_blocking_vulnerability_reports, STRIX_FAIL_ON_MIN_SEVERITY): a real finding still fails closed exactly as before. Only this one cosmetic, always-present-on-non-frontier-models disclaimer is excluded from the generic infra-error matcher. New regression test console-model-quality-warning-banner-sanitized reproduces the exact TEPP#214 failure via the existing fake-strix-stub harness: fails with "Strix run emitted provider infrastructure or failure-signal output; failing closed." on the pre-fix gate script, passes on the post-fix version. Verified both directions locally (git stash of strix_quick_gate.sh alone reproduces the failure; restoring it passes) via STRIX_TEST_CASE_FILTER=console-model-quality-warning-banner-sanitized.
|
Warning Review limit reachedNext included review available in 19 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| model_quality_banner = re.compile( | ||
| r"╭─[^\n]*╮\n" | ||
| r"(?:[^\n]*\n)*?" | ||
| r"[^\n]*MODEL QUALITY WARNING[^\n]*\n" | ||
| r"(?:[^\n]*\n)*?" | ||
| r"╰─[^\n]*╯\n?" | ||
| ) |
There was a problem hiding this comment.
📝 Info: Banner regex can span a preceding box
The banner regex (scripts/ci/strix_quick_gate.sh:181-187, 235-241) anchors on the first ╭─...╮ and scans forward to the MODEL QUALITY WARNING line. If Strix emits any box before the warning box, the leading (?:[^\n]*\n)*? consumes it too, deleting both boxes and everything between. Startup content is benign, but a real failure signal printed between those boxes would be stripped.
Was this helpful? React with 👍 or 👎 to provide feedback.
| preserve_attempt_log "$model" "$rc" | ||
| sanitize_strix_console_log "$STRIX_LOG" |
There was a problem hiding this comment.
📝 Info: Published last-attempt log has banner stripped
preserve_attempt_log copies the raw transcript before sanitization, so the per-attempt archive keeps the banner. But publish_artifact_reports copies $STRIX_LOG to gate-last-attempt.log in the cleanup trap, which runs after sanitization (scripts/ci/strix_quick_gate.sh:131-132), so that published copy loses the banner. Audit fidelity only; the full transcript survives under gate-attempts/.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Note on the failing `strix` check here: it's the exact bug this PR fixes, reproducing on itself. `strix_quick_gate.sh` resolves its "trusted Strix source" from `main` (by design — a PR can't be allowed to rewrite its own security gate to auto-pass), so this PR's own scan still runs the pre-fix script and hits the same MODEL QUALITY WARNING false fail-closed described above (confirmed in the job log: clean "Vulnerabilities 0" summary, then "Strix run emitted provider infrastructure or failure-signal output; failing closed."). This is a chicken-and-egg case — the fix can't pass its own gate until it's merged. Every other check has passed: CodeQL, Semgrep (SAST + OSS), gitleaks, trivy-fs, dependency-review, SBOM generation, pip-audit, osv-scan, Scorecard, Devin Review, CodeRabbit, coverage-evidence/coverage-source-tree, noema-review, and opencode-review. Full local regression run of `test_strix_quick_gate.sh` (120 cases, including the new red/green-verified `console-model-quality-warning-banner-sanitized` case) also passes with no other-scenario regressions. Flagging for whoever has merge authority here, consistent with the same one-off-intervention pattern used for prior self-referential CI-pipeline fixes in this repo. |
|
Fresh downstream canary for this exact false-fail boundary (2026-08-25 KST): canonical Security Scan owner PR Acceptance after this repair integrates: rerun unchanged/current #897. A complete authoritative fallback that reports zero findings must no longer be rejected solely because of the model-quality disclaimer, while genuine provider/incomplete-scan signals and real vulnerability findings must remain fail-closed. Once #897 is green on its unchanged exact head and its exact-head binding fix integrates, regenerate ScopeWeave #523/#553 Security evidence against their then-current contributor heads. Later fallback/provider-routing errors (for example direct-provider 404/rate-limit paths) remain separate owner lanes; this comment is specifically the reproduced benign-warning false-failure boundary. |
|
Second live canary from the other canonical ScopeWeave #1222 owner path: This matters directly to ScopeWeave because #941 is the canonical SAST Semgrep owner needed to repair the synthetic-checkout defect tracked by |
|
Current-head repair note after verifying the two unresolved Devin findings against
After those regressions are GREEN, rerun the full Strix gate suite and then the live #897/#941 canaries. This preserves the intended false-fail repair without creating a fail-open erasure path or weakening evidence provenance. |
Problem
Strix prints a box-drawn
MODEL QUALITY WARNINGbanner at startup whenever the configured model is not on its own hardcoded list of recommended frontier models — a static disclaimer about model choice, unrelated to the scan's actual outcome:The banner's literal
WARNINGtext satisfieshas_detected_infrastructure_error()'s genericFatal|Denied|Warn|Warningsubstring matcher against$STRIX_LOG(and the equivalenthas_strix_report_failure_signal()matcher against report.logartifacts), so any clean, 0-vulnerability scan on the org's configured default model is misclassified as a provider infrastructure failure and fails closed, even though the scan itself succeeded (rc=0) with zero findings.Reproduced directly from a real PR
TEPP#214's
strixrequired check failed with:...while its own captured transcript shows a complete penetration-test summary reporting "Low" risk posture and "Vulnerabilities 0".
STRIX_LLM_DEFAULT_PROVIDER: nvidia_nimresolves tonvidia_nim/nvidia/nemotron-3-super-120b-a12b, which is not on Strix's recommended list, so this banner — and this false failure — fires on every successful scan using the org's own configured default model.The same banner text (6 occurrences across fallback attempts) also appears in fast-mlsirm PR #1237's
strixjob log. GivenSTRIX_LLM_DEFAULT_PROVIDERis an org-wide default, this likely contributes to the "zero PRs mergeable" pattern tracked in #1212.Fix
Strip the banner — matched structurally by its box-drawing delimiters plus the
MODEL QUALITY WARNINGmarker line, so it does not depend on the exact recommended-model list or wrapped text — from:$STRIX_LOG(newsanitize_strix_console_log, called right afterpreserve_attempt_logso the unmodified transcript is still archived for audit) beforehas_detected_infrastructure_error()runs, and.logfiles insidesanitize_known_strix_report_warnings()beforehas_strix_report_failure_signal()runs — mirroring the existing, narrowly-scoped sanitization already used there for Strix's other known-benign internal warning (strix.core.execution: agent ... forcing tool continuation).This does not touch vulnerability-severity classification (
reported_vulnerability_signal,has_blocking_vulnerability_reports,STRIX_FAIL_ON_MIN_SEVERITY) — a real finding still fails closed exactly as before. Only this one cosmetic, always-present-on-non-frontier-models disclaimer is excluded from the generic infra-error matcher.Testing
New regression case
console-model-quality-warning-banner-sanitizedreproduces the exact TEPP#214 failure via the existing fake-strix-stub harness (emits the real banner + a cleanVulnerabilities 0summary +exit 0).git stashofstrix_quick_gate.shalone (keeping the new test) reproducesStrix run emitted provider infrastructure or failure-signal output; failing closed.— 2 failures.STRIX_TEST_CASE_FILTER=console-model-quality-warning-banner-sanitized bash scripts/ci/test_strix_quick_gate.shexits 0.test_strix_quick_gate.shsuite (120 cases) run locally in the background to confirm no regressions in the other scenarios; will also run as this PR's own required CI.🤖 Generated with Claude Code