Skip to content

Harden Strix fallback routing and large-diff completion handling#288

Closed
seonghobae with Copilot wants to merge 4 commits into
mainfrom
copilot/task-295022177-1274066402-da0d9703-ae35-44e8-8eda-910834b11f8b
Closed

Harden Strix fallback routing and large-diff completion handling#288
seonghobae with Copilot wants to merge 4 commits into
mainfrom
copilot/task-295022177-1274066402-da0d9703-ae35-44e8-8eda-910834b11f8b

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Strix quick scans could report Penetration test completed and still fail afterward while evaluating PR-scoped findings on large diffs. Separately, the GitHub Models fallback pool could select tool-incompatible models and stop recovery with UnsupportedToolUse.

  • PR-scoped finding evaluation

    • Reworked changed-line intersection checks to read diff content from a temporary file instead of exporting the full diff through DIFF_OUTPUT.
    • Preserves line-level PR gating semantics without tripping Argument list too long after a completed scan.
    diff_output_file="$(mktemp "${TMPDIR:-/tmp}/strix-diff.XXXXXX")"
    printf '%s' "$diff_output" >"$diff_output_file"
    python3 - "$diff_output_file" "$start_line" "$end_line" <<'PY'
    ...
    PY
  • GitHub Models fallback routing

    • Reduced the GitHub Models fallback list to tool-capable OpenAI models only:
      • github_models/openai/o3
      • github_models/openai/gpt-5-chat
    • Removed forced DeepSeek fallback routing from the workflow path that requires tool use.
  • Fallback error classification

    • Treats GitHub Models UnsupportedToolUse as a model-availability/provider-routing failure so the gate can continue to the next configured fallback instead of hard-stopping on the first incompatible candidate.
  • Fallback diagnostics

    • Updated failed-check guidance to point reviewers at the new approved GitHub Models fallback list and to stop suggesting DeepSeek-based fallback routing for this workflow.
  • Regression coverage

    • Updated the Strix shell test matrix and fallback expectations to reflect:
      • temp-file diff evaluation
      • UnsupportedToolUse recovery
      • the new GitHub Models fallback sequence

@seonghobae seonghobae marked this pull request as ready for review July 2, 2026 13:29
Copilot AI review requested due to automatic review settings July 2, 2026 13:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR hardens Strix quick-scan gating for large PR diffs and makes GitHub Models fallback routing more reliable by avoiding tool-incompatible models and classifying UnsupportedToolUse as a recoverable fallback condition.

Changes:

  • Switched PR-scoped changed-line/diff intersection evaluation from env var (DIFF_OUTPUT) to a temporary file to avoid Argument list too long after large diffs.
  • Restricted GitHub Models fallbacks to tool-capable OpenAI models and removed DeepSeek routing for the tool-using workflow path.
  • Updated fallback error classification and CI regression tests to allow continuing after UnsupportedToolUse.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
scripts/ci/strix_quick_gate.sh Uses temp-file diff parsing for changed-line overlap; classifies UnsupportedToolUse as a fallbackable GitHub Models availability failure.
.github/workflows/strix.yml Narrows GitHub Models fallback list to github_models/openai/o3 and github_models/openai/gpt-5-chat.
scripts/ci/emit_opencode_failed_check_fallback_findings.sh Updates failed-check guidance to match the new approved fallback list and remove DeepSeek suggestions.
scripts/ci/test_strix_quick_gate.sh Updates shell test expectations and fake Strix scenarios for the new diff handling and fallback sequence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1875 to +1906
local diff_output_file
diff_output_file="$(mktemp "${TMPDIR:-/tmp}/strix-diff.XXXXXX")" || {
echo "ERROR: unable to create temporary diff file for changed-line evaluation." >&2
return 1
}
printf '%s' "$diff_output" >"$diff_output_file"
python3 - "$diff_output_file" "$start_line" "$end_line" <<'PY'
import re
import sys

target_start = int(sys.argv[1])
target_end = int(sys.argv[2])
diff_output_path = sys.argv[1]
target_start = int(sys.argv[2])
target_end = int(sys.argv[3])
hunk_re = re.compile(r"^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@")
for line in os.environ.get("DIFF_OUTPUT", "").splitlines():
match = hunk_re.match(line)
if not match:
continue
start = int(match.group(1))
count = int(match.group(2) or "1")
if count == 0:
continue
end = start + count - 1
if start <= target_end and target_start <= end:
raise SystemExit(0)
with open(diff_output_path, "r", encoding="utf-8") as handle:
for raw_line in handle:
line = raw_line.rstrip("\n")
match = hunk_re.match(line)
if not match:
continue
start = int(match.group(1))
count = int(match.group(2) or "1")
if count == 0:
continue
end = start + count - 1
if start <= target_end and target_start <= end:
raise SystemExit(0)
raise SystemExit(1)
PY
local intersects_rc=$?
rm -f -- "$diff_output_file"
return "$intersects_rc"
Comment on lines +2602 to +2605
if grep -Eiq '(UnsupportedToolUse|tool use\. Using tool is not supported by this model|Using tool is not supported by this model)' "$STRIX_LOG" &&
grep -Eiq '(models\.github\.ai|GitHub Models|openai|OpenAIException)' "$STRIX_LOG"; then
return 0
fi
@seonghobae

Copy link
Copy Markdown
Contributor

Superseded by #292, which carries this PR's four Strix fallback commits and adds the review-requested fixes for temp diff cleanup plus GitHub Models-specific UnsupportedToolUse fallback classification. Closing this non-maintainable branch keeps the central remediation path on the current, editable PR.

@seonghobae seonghobae closed this Jul 2, 2026
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.

3 participants