Skip to content

fix(pr-review): robust engine fallback and context optimization - #227

Merged
don-petry merged 23 commits into
mainfrom
fix/pr-review-fallback-robustness
May 18, 2026
Merged

don-petry merged 23 commits into
mainfrom
fix/pr-review-fallback-robustness

Conversation

@don-petry

@don-petry don-petry commented May 17, 2026 •

Copy link
Copy Markdown
Collaborator

This PR improves the robustness of the PR review agent when primary engines (Claude, Gemini) are rate-limited.

Changes:

  • engine.sh: Implemented a more robust write-operation fallback that tries Claude then Gemini if the primary engine (e.g. Copilot) cannot perform write operations.
  • engine.sh: Enhanced copilot_chat to handle 413 (Payload Too Large) errors by retrying with gpt-4o, which often has higher limits than o4-mini in the GitHub Models API.
  • review-one-pr.sh: Optimized triage context by simplifying the file list in metadata and aggressively trimming the diff head (50 lines) when using the Copilot engine. This avoids hitting strict token limits and content filters.

Testing:

  • Verified that the agent correctly cascades from Claude -> Gemini -> Copilot.
  • Verified that the triage context optimizations successfully bypassed 413 and 400 (content filter) errors on Copilot, allowing it to reach the actual 429 quota limit.

Summary by CodeRabbit

  • Improvements
    • Enhanced rate-limit detection with broader pattern matching and explicit HTTP 529 status recognition.
    • Improved error handling and fallback recovery mechanisms for PR review operations with better diagnostics.
    • Optimized metadata fetching with streamlined payloads and intelligent engine-aware diff processing.
    • Strengthened Copilot integration with native CLI invocation and enhanced fallback logic across multiple operations.

Review Change Stack

Copilot AI review requested due to automatic review settings May 17, 2026 18:45
@coderabbitai

coderabbitai Bot commented May 17, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR refactors GitHub Actions intent context metadata to include actor and review body, centralizes engine model configuration, rewrites Copilot integration to use gh copilot CLI directly instead of REST API, expands rate-limit detection patterns, and hardens triage error handling with stderr capture and JSON validation.

Changes

Intent Metadata Enrichment and Engine Integration Updates

Layer / File(s) Summary
Intent context enrichment with actor and review body
scripts/dev-lead-intent.sh
emit_intent now writes to GITHUB_OUTPUT with lowercase keys and multiline-safe heredoc for intent_context. Pull request opened|reopened and synchronize actions generate jq-constructed JSON context including actor alongside pr_number and head_sha. Pull request review actions now extract and include body from review.body in JSON context.
Comment author association sourcing
scripts/dev-lead-intent.sh
For pull_request_review_comment and issue_comment events, author_assoc is now sourced from comment.author_association instead of PR/issue payload, ensuring trust-routing checks use the commenter's actual association.
Engine configuration function and model centralization
scripts/engine.sh
New set_engine_config() function centralizes per-engine model identifiers and labels plus cross-engine rubber-duck configuration for claude, gemini, and copilot. Replaces prior top-level case block with single initialization call, enabling dynamic refresh during fallback iterations.
Rate-limit detection expansion
scripts/engine.sh
is_rate_limited() regex patterns expanded to include broader reset wording, explicit HTTP 529 status matching, and extended token/quota/service-overload and plan-limit detection.
Copilot integration rewrite from REST API to gh copilot CLI
scripts/engine.sh
copilot_chat reimplemented to invoke gh copilot CLI directly, validates GH_TOKEN/COPILOT_GITHUB_TOKEN, reads prompt file, passes prompt via -p, forwards extra CLI flags, runs under timeout, and streams output for rate-limit detection.
Copilot call site updates
scripts/engine.sh
All Copilot code paths refactored: run_triage uses copilot_chat --deny-tool "*"; run_agentic and run_duck switch to copilot_chat --yolo with tee streaming; run_writer becomes directly supported via copilot_chat --yolo (removes fallback-to-Claude warning).
Writer fallback with per-attempt engine refresh
scripts/engine.sh
run_writer_with_fallback calls set_engine_config() before each fallback attempt, invokes run_writer without explicit model argument (uses refreshed ENGINE_ACTION_MODEL), and restores original config after each attempt.
PR metadata optimization and engine-aware diff truncation
scripts/review-one-pr.sh
Reduces PR_METADATA payload via curated field list and lightweight file array (path/status/additions/deletions). Diff prefetch truncation now engine-aware: copilot uses 1000-line slice, others use 3000-line slice.
Triage error hardening with stderr capture and rate-limit re-checking
scripts/review-one-pr.sh
Triage tier captures stderr into TRIAGE_STDERR and checks for rate-limit before other logic (exits code 2 on match). On non-zero exit, checks stdout for rate-limit (exit 2) or CLI-format errors (exit 1). On success, validates JSON after cleaning markdown fences and re-checks rate-limit in non-JSON output.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related issues

  • petry-projects/.github-private#208: Main changes to engine.sh rate-limit regex, copilot_chat rewrite, and review-one-pr.sh exit-code handling directly affect fallback/error-handling code paths causing Claude→Gemini→Copilot cascade failures.
  • petry-projects/.github-private#195: Changes to engine.sh (set_engine_config, copilot_chat behavior, run_writer_with_fallback signature) directly impact the same engine initialization and fallback functions.

Possibly related PRs

  • petry-projects/.github-private#176: Both PRs modify scripts/review-one-pr.sh rate-limit detection (429) and stderr/stdout branching logic with specific exit codes for fallback triggering.
  • petry-projects/.github-private#149: Both PRs update scripts/engine.sh is_rate_limited() patterns and scripts/review-one-pr.sh routing around rate-limit vs non-rate-limit failures.
  • petry-projects/.github-private#188: Main PR changes run_writer_with_fallback behavior/signature (engine config and exit status), directly connected to retrieved PR's dev-lead-fix-ci.sh CI-fixing logic that consumes run_writer_with_fallback exit codes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding robust engine fallback (via set_engine_config and run_writer_with_fallback) and optimizing context (metadata simplification and diff truncation in PR review).
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr-review-fallback-robustness

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request enhances the robustness and efficiency of the LLM-driven development scripts. Key improvements include refactoring engine configuration into a reusable function, implementing a fallback to gpt-4o for Copilot when encountering payload size errors, and optimizing GitHub CLI metadata retrieval to conserve tokens. Additionally, JSON handling was improved using jq and heredocs with random delimiters. Review feedback suggests further hardening the scripts by ensuring consistent authorization guards for API retries, simplifying redundant fallback logic in the writer functions, and using temporary files to process large JSON payloads to avoid shell argument limits.

Comment thread scripts/engine.sh Outdated
" "$_body_file" > "$_body_file.tmp" && mv "$_body_file.tmp" "$_body_file"

timeout "$timeout_sec" curl -sSL \
-H "Authorization: Bearer ${COPILOT_GITHUB_TOKEN}" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency and robustness, use the same authorization guard for the retry call as used in the initial call (line 191). This ensures the script fails with a clear error message if the token is missing or unset.

Suggested change
-H "Authorization: Bearer ${COPILOT_GITHUB_TOKEN}" \
-H "Authorization: Bearer ${COPILOT_GITHUB_TOKEN:?COPILOT_GITHUB_TOKEN is required for copilot engine}" \

Comment thread scripts/engine.sh
Comment on lines 516 to 549
copilot)
# Copilot (gh copilot suggest) is text-only — falls back to Claude for write ops
echo "::warning::Copilot engine is text-only; falling back to Claude for write operations" >&2
local saved="$REVIEW_ENGINE"
REVIEW_ENGINE="claude" timeout "$ACTION_TIMEOUT_SEC" claude --print \
--model "$model" \
# Copilot (gh copilot suggest) is text-only — falls back to other engines for write ops
echo "::warning::Copilot engine is text-only; falling back to Claude/Gemini for write operations" >&2
local saved_engine="$REVIEW_ENGINE"
local fallback_rc=1

# Try Claude first
export REVIEW_ENGINE="claude"
set_engine_config
# run_writer calls itself via case, but since we exported REVIEW_ENGINE and called set_engine_config,
# we can just call the claude logic directly or recursively.
# To avoid infinite recursion, we'll just use a subshell or call claude logic.
timeout "$ACTION_TIMEOUT_SEC" claude --print \
--model "$ENGINE_ACTION_MODEL" \
--permission-mode acceptEdits \
--allowed-tools "Bash,Read,Write,Edit,Grep,Glob" \
< "$prompt_file" | tee "$_tmp" || rc=${PIPESTATUS[0]}
REVIEW_ENGINE="$saved"
< "$prompt_file" | tee "$_tmp" && fallback_rc=0 || fallback_rc=${PIPESTATUS[0]}

# If Claude is rate-limited, try Gemini
if [ "$fallback_rc" -eq 2 ] || [ "$fallback_rc" -eq 127 ]; then
echo "::warning::Claude fallback rate-limited or unavailable, trying Gemini" >&2
export REVIEW_ENGINE="gemini"
set_engine_config
timeout "$ACTION_TIMEOUT_SEC" gemini --prompt "" \
--model "$ENGINE_ACTION_MODEL" \
--approval-mode auto_edit \
--output-format text \
< "$prompt_file" | tee "$_tmp" && fallback_rc=0 || fallback_rc=${PIPESTATUS[0]}
fi

rc=$fallback_rc
export REVIEW_ENGINE="$saved_engine"
set_engine_config
;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The copilot case in run_writer manually implements a fallback to Claude and Gemini. However, run_writer_with_fallback (lines 573-590) already iterates through all available engines when a rate limit (exit code 2) is encountered. By implementing a nested fallback here, you are effectively trying each engine multiple times if they are rate-limited, which is redundant and increases complexity. Simplifying this to return exit code 2 aligns with repository standards for LLM retry loops and correctly triggers the outer fallback mechanism.

Suggested change
copilot)
# Copilot (gh copilot suggest) is text-only — falls back to Claude for write ops
echo "::warning::Copilot engine is text-only; falling back to Claude for write operations" >&2
local saved="$REVIEW_ENGINE"
REVIEW_ENGINE="claude" timeout "$ACTION_TIMEOUT_SEC" claude --print \
--model "$model" \
# Copilot (gh copilot suggest) is text-only — falls back to other engines for write ops
echo "::warning::Copilot engine is text-only; falling back to Claude/Gemini for write operations" >&2
local saved_engine="$REVIEW_ENGINE"
local fallback_rc=1
# Try Claude first
export REVIEW_ENGINE="claude"
set_engine_config
# run_writer calls itself via case, but since we exported REVIEW_ENGINE and called set_engine_config,
# we can just call the claude logic directly or recursively.
# To avoid infinite recursion, we'll just use a subshell or call claude logic.
timeout "$ACTION_TIMEOUT_SEC" claude --print \
--model "$ENGINE_ACTION_MODEL" \
--permission-mode acceptEdits \
--allowed-tools "Bash,Read,Write,Edit,Grep,Glob" \
< "$prompt_file" | tee "$_tmp" || rc=${PIPESTATUS[0]}
REVIEW_ENGINE="$saved"
< "$prompt_file" | tee "$_tmp" && fallback_rc=0 || fallback_rc=${PIPESTATUS[0]}
# If Claude is rate-limited, try Gemini
if [ "$fallback_rc" -eq 2 ] || [ "$fallback_rc" -eq 127 ]; then
echo "::warning::Claude fallback rate-limited or unavailable, trying Gemini" >&2
export REVIEW_ENGINE="gemini"
set_engine_config
timeout "$ACTION_TIMEOUT_SEC" gemini --prompt "" \
--model "$ENGINE_ACTION_MODEL" \
--approval-mode auto_edit \
--output-format text \
< "$prompt_file" | tee "$_tmp" && fallback_rc=0 || fallback_rc=${PIPESTATUS[0]}
fi
rc=$fallback_rc
export REVIEW_ENGINE="$saved_engine"
set_engine_config
;;
copilot)
# Copilot (gh copilot suggest) is text-only — trigger fallback to other engines for write ops
echo "::warning::Copilot engine is text-only; triggering fallback for write operations" >&2
return 2
;;
References
  1. In shell scripts implementing retry loops for LLM-based tasks, detect rate limits and exit with code 2 to enable engine fallback mechanisms in the calling process.

Comment thread scripts/review-one-pr.sh Outdated
if [ "${REVIEW_ENGINE:-claude}" = "copilot" ]; then
_diff_limit=50
# Remove the bulky body from metadata for Copilot to save tokens and avoid content filters
PR_METADATA=$(echo "$PR_METADATA" | jq 'del(.body)')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using echo to pipe a variable containing arbitrary JSON can be unsafe. Furthermore, for large JSON payloads (like PR metadata which includes the body), passing data via command-line arguments can exceed the ARG_MAX limit. To ensure robustness and follow repository guidelines, use a temporary file to process the JSON.

Suggested change
PR_METADATA=$(echo "$PR_METADATA" | jq 'del(.body)')
printf '%s' "$PR_METADATA" > pr_metadata.json && PR_METADATA=$(jq 'del(.body)' pr_metadata.json) && rm pr_metadata.json
References
  1. When passing large JSON payloads in shell scripts, use a temporary file to avoid exceeding the ARG_MAX command-line argument limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 846afe1ce3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/review-one-pr.sh Outdated
Comment on lines +288 to +291
if [ "${REVIEW_ENGINE:-claude}" = "copilot" ]; then
_diff_limit=50
# Remove the bulky body from metadata for Copilot to save tokens and avoid content filters
PR_METADATA=$(echo "$PR_METADATA" | jq 'del(.body)')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep enough diff context before approving Copilot triage

When REVIEW_ENGINE=copilot, triage now sees only the first 50 lines of the PR diff even though prompts/triage.md says this tier has no tools and must decide from the inlined context. In the existing approval path, a TRIAGE_ESCALATE=false result can proceed to the single-review/post step, so any risky hunk or obvious anti-pattern after line 50 in a large PR is invisible to the gate except for the filename summary. This can let the automation approve PRs whose relevant changes are simply beyond the truncated head; prefer truncating in a way that preserves all changed file/hunk headers or forcing escalation when the diff is truncated.

Useful? React with 👍 / 👎.

Comment on lines +36 to +40
{
echo "INTENT_CONTEXT<<$EOF_DELIMITER"
echo "${context}"
echo "$EOF_DELIMITER"
} >> "$GITHUB_ENV"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update local context readers for heredoc output

Switching INTENT_CONTEXT to the KEY<<EOF format means the existing local test/helpers that read the classifier output with grep '^INTENT_CONTEXT=' no longer find any context; for example the repository_dispatch context tests now parse an empty string instead of the PR/check payload. If CI runs these Bats suites, this change breaks the dev-lead tests even though the workflow runner can consume heredoc env files, so the helper/parser needs to be updated alongside this output format change.

Useful? React with 👍 / 👎.

Comment thread scripts/engine.sh Outdated
Comment on lines +203 to +205
# If 413 (Payload Too Large) and we used o4-mini, try gpt-4o as a last-resort fallback.
# o4-mini sometimes has very tight (4k) input limits on the free-tier gateway.
if [ "$http_code" -eq 413 ] && [[ "${COPILOT_API_MODEL:-}" == *"o4-mini"* ]]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retry 413s when Copilot is used as the duck engine

In the default Claude review flow, DUCK_ENGINE=copilot calls copilot_chat while COPILOT_API_MODEL is unset, so the request still defaults to openai/o4-mini but this [[ ... == *"o4-mini"* ]] guard is false. A 413 from the Copilot rubber-duck pass therefore never retries with gpt-4o, and large PRs lose the cross-engine check exactly in the payload-limit case this change is meant to handle. Compare against the effective default model or initialize COPILOT_API_MODEL before all Copilot calls.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 327cbbbf5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/engine.sh Outdated
Comment on lines +164 to +166
timeout "$timeout_sec" gh copilot \
--model "$COPILOT_API_MODEL" \
-p "$(cat "$prompt_file")" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Initialize Copilot model before duck calls

When the default Claude review reaches the rubber-duck path, DUCK_ENGINE=copilot but set_engine_config never sets COPILOT_API_MODEL unless the primary REVIEW_ENGINE is copilot; with set -u, expanding $COPILOT_API_MODEL here aborts before gh copilot runs. I reproduced this by sourcing this version of engine.sh with REVIEW_ENGINE=claude and calling copilot_chat, which fails with COPILOT_API_MODEL: unbound variable, so the cross-engine duck check is silently unavailable for escalated Claude reviews.

Useful? React with 👍 / 👎.

Comment thread scripts/review-one-pr.sh Outdated
Comment on lines +343 to +344
TRIAGE_STDERR=$(cat "$TRIAGE_LOG" 2>/dev/null || true)
# TRIAGE_STDERR is always process output — safe to check unconditionally.
# TRIAGE_RESULT is gated on rc != 0 to avoid false positives: the triage prompt
# inlines the full PR diff, so a PR adding "429 rate-limit handling" could
# produce valid JSON with matching text in signals/summary, incorrectly
# triggering engine fallback on a healthy call that exited 0.
if is_rate_limited "$TRIAGE_STDERR"; then
if is_rate_limited "$TRIAGE_STDERR" || is_rate_limited "$TRIAGE_RESULT"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Only scan triage stdout after failures

For a successful triage response, TRIAGE_RESULT is model JSON and can legitimately contain strings like rate-limit or 429 in signals/summary when the PR itself changes rate-limit handling; this unconditional check then exits 2 and tells review-batch.sh to switch engines even though the model call succeeded. The previous gating avoided this exact false positive by only inspecting stdout for rate-limit text on nonzero exits; keep stdout checks tied to TRIAGE_RC != 0 and use stderr unconditionally.

Useful? React with 👍 / 👎.

Comment thread scripts/engine.sh
< "$prompt_file" | tee "$_tmp" || rc=${PIPESTATUS[0]}
REVIEW_ENGINE="$saved"
# Self-sufficient write support via gh copilot --yolo
copilot_chat "$prompt_file" "$ACTION_TIMEOUT_SEC" --yolo | tee "$_tmp" || rc=${PIPESTATUS[0]}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add autopilot to non-interactive Copilot writers

When Copilot is the primary or final fallback engine for fix-ci/fix-reviews/issue work, this invokes prompt mode with only --yolo; the Copilot CLI docs distinguish this as permissions-only and state that --autopilot is what enables programmatic continuation through successive steps, with the example copilot --autopilot --yolo ... -p. In a CI writer flow with no human present, Copilot can stop at the first continuation/decision point instead of carrying the task through edits/tests, so the new “self-sufficient write support” is unreliable unless these write calls also opt into autopilot with a continuation cap.

Useful? React with 👍 / 👎.

Comment thread scripts/engine.sh Outdated
# is plenty for PR diffs and metadata.
timeout "$timeout_sec" gh copilot \
--model "$COPILOT_API_MODEL" \
-p "$(cat "$prompt_file")" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid passing large Copilot prompts via argv

For Copilot triage, the prompt now includes PR metadata plus up to 1000 diff lines, but $(cat "$prompt_file") expands the whole prompt into a single command-line argument; a PR with minified/generated lines or a large body can exceed the runner's ARG_MAX and fail before gh copilot even starts. The previous REST path wrote the payload to a temp file to avoid this, so this should use a stdin/file-based CLI mode or enforce a byte-size cap rather than a line count.

Useful? React with 👍 / 👎.

Comment thread scripts/engine.sh Outdated
ENGINE_SINGLE_MODEL="gpt-4o"
# GitHub Models API model identifier. openai/gpt-4o is a flagship model
# with full tool support in the Copilot CLI.
COPILOT_API_MODEL="${COPILOT_API_MODEL:-openai/gpt-4o}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a Copilot CLI model name

This default is still a GitHub Models REST identifier, but the new copilot_chat path passes it directly to gh copilot --model; Copilot CLI model selection uses Copilot model names/aliases such as gpt-4o, auto, or the displayed Copilot model names, not the provider-prefixed openai/... API IDs. When REVIEW_ENGINE=copilot or writer fallback reaches Copilot, the first call can fail as an invalid model instead of reviewing or applying fixes.

Useful? React with 👍 / 👎.

Comment thread scripts/engine.sh
< "$prompt_file" | tee "$_tmp" || rc=${PIPESTATUS[0]}
REVIEW_ENGINE="$saved"
# Self-sufficient write support via gh copilot --yolo
copilot_chat "$prompt_file" "$ACTION_TIMEOUT_SEC" --yolo | tee "$_tmp" || rc=${PIPESTATUS[0]}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Capture Copilot writer stderr for rate-limit fallback

In the writer path this only tees stdout into _tmp, so if gh copilot reports a quota/rate-limit error on stderr—as the triage path in this same script accounts for—the subsequent is_rate_limited "$(cat "$_tmp")" check misses it and returns a plain failure. In that scenario run_writer_with_fallback stops without trying the remaining engines or posting the rate-limited marker, which is exactly the recovery path this change is meant to provide.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/engine.sh (1)

432-432: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Update function signature comment.

The comment states run_writer_with_fallback <prompt_file> [model], but the function no longer accepts or uses a model parameter. Line 436 only captures prompt_file, and line 450 calls run_writer without passing a model argument (intentionally using $ENGINE_ACTION_MODEL from the refreshed config per line 447).

Proposed fix
-# run_writer_with_fallback <prompt_file> [model]
+# run_writer_with_fallback <prompt_file>
 # Tries primary engine, falls back through claude → gemini → copilot on rate-limit.
 # Only rate-limit (exit 2) triggers fallback; other failures propagate immediately.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/engine.sh` at line 432, Update the function signature comment for
run_writer_with_fallback to reflect that it only accepts a single parameter
(prompt_file) and no longer takes a model; change the comment from
"run_writer_with_fallback <prompt_file> [model]" to "run_writer_with_fallback
<prompt_file>" and ensure references to run_writer and ENGINE_ACTION_MODEL
remain unchanged in the surrounding code.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/engine.sh`:
- Around line 161-164: Remove the speculative comment about COPILOT_PROMPT in
scripts/engine.sh and replace it with a factual note: either delete the line
claiming "The Copilot CLI supports COPILOT_PROMPT env var as an alternative to
-p" or change it to state that such an env var is not currently supported by
this script and that the script uses -p with careful handling to avoid ARG_MAX;
reference COPILOT_PROMPT and -p in the note so future maintainers know the exact
symbols to check.
- Around line 161-173: The current code reads the prompt_file into prompt_text
and passes it with -p (lines using prompt_text and prompt_file), which risks
ARG_MAX; change the gh copilot invocation in the block that references
COPILOT_API_MODEL and timeout_sec to call gh copilot --prompt-file
"$prompt_file" (remove the prompt_text="$(cat ...)" and the -p "$prompt_text"
usage), keeping the timeout "$timeout_sec" and other flags intact; optionally
preserve COPILOT_PROMPT support by exporting it earlier but do not pass large
prompt data via command-line arguments.
- Around line 35-72: The COPILOT_API_MODEL value uses a GitHub Models REST API
identifier ("openai/gpt-4o") which is not a valid gh copilot CLI model name;
update the copilot case to either remove the provider prefix (set
COPILOT_API_MODEL to "gpt-4o") or set it to a CLI-supported token like "auto"
(or remove/export it entirely) so the gh copilot CLI receives a supported model
string; edit the copilot block where COPILOT_API_MODEL is set and exported to
replace "openai/gpt-4o" with a CLI-compatible model name or fallback "auto", or
alternatively stop using COPILOT_API_MODEL and switch to calling the GitHub
Models REST API if provider-prefixed identifiers are required.

In `@scripts/review-one-pr.sh`:
- Around line 343-348: The script currently checks is_rate_limited on
TRIAGE_RESULT before verifying TRIAGE_RESULT is valid JSON, causing legitimate
JSON verdicts that mention rate limits to trigger fallback; modify the logic
around TRIAGE_RESULT and TRIAGE_STDERR so you first sanitize TRIAGE_RESULT
(remove triple-backtick fences), then test JSON validity with jq (or check the
triage process exit), and only if JSON parsing fails run is_rate_limited against
TRIAGE_RESULT (and still always inspect TRIAGE_STDERR); update the block that
references TRIAGE_RESULT, TRIAGE_STDERR and is_rate_limited to gate the
TRIAGE_RESULT rate-limit check behind a failed jq parse while keeping stderr
handling unconditional.

---

Outside diff comments:
In `@scripts/engine.sh`:
- Line 432: Update the function signature comment for run_writer_with_fallback
to reflect that it only accepts a single parameter (prompt_file) and no longer
takes a model; change the comment from "run_writer_with_fallback <prompt_file>
[model]" to "run_writer_with_fallback <prompt_file>" and ensure references to
run_writer and ENGINE_ACTION_MODEL remain unchanged in the surrounding code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 659f9193-b2ab-45bf-bf1b-3c381129da8b

📥 Commits

Reviewing files that changed from the base of the PR and between 89b7695 and f02d03b.

📒 Files selected for processing (6)
  • .github/workflows/dev-lead.yml
  • scripts/dev-lead-fix-issue.sh
  • scripts/dev-lead-fix-reviews.sh
  • scripts/dev-lead-intent.sh
  • scripts/engine.sh
  • scripts/review-one-pr.sh

Comment thread scripts/engine.sh
Comment thread scripts/engine.sh Outdated
Comment thread scripts/engine.sh Outdated
Comment on lines +161 to +173
# Avoid ARG_MAX by using an env var for the prompt if possible, or attachment.
# The Copilot CLI supports COPILOT_PROMPT env var as an alternative to -p.
# (Assuming this in 2026 based on common patterns).
# If not, we'll just use -p with the file content but very carefully.
local prompt_text
prompt_text=$(cat "$prompt_file")

echo " [copilot] calling gh copilot (model=$COPILOT_API_MODEL, timeout=${timeout_sec}s, flags=$*)" >&2

# Extract the assistant message from the JSON response.
printf '%s' "$response_body" | python3 -c "
import json, sys
try:
data = json.load(sys.stdin)
except json.JSONDecodeError as e:
print('copilot_chat: invalid JSON response: ' + str(e), file=sys.stderr)
sys.exit(1)
if 'error' in data:
err = data['error']
msg = err.get('message', str(err)) if isinstance(err, dict) else str(err)
print('copilot_chat: API error: ' + str(msg), file=sys.stderr)
sys.exit(1)
choices = data.get('choices', [])
if not choices:
print('copilot_chat: empty choices in response', file=sys.stderr)
sys.exit(1)
content = choices[0].get('message', {}).get('content', '')
print(content, end='')
" || return 1
# We use -p for the prompt.
timeout "$timeout_sec" gh copilot \
--model "$COPILOT_API_MODEL" \
-p "$prompt_text" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check gh copilot CLI prompt options
if command -v gh &>/dev/null && gh copilot --version &>/dev/null; then
  echo "=== gh copilot help output ==="
  gh copilot --help 2>&1 | grep -E -A2 -i 'prompt|input|file'
fi

Repository: petry-projects/.github-private

Length of output: 105


🌐 Web query:

gh copilot CLI how to pass large prompts file or stdin

💡 Result:

To pass large prompts or file content to the GitHub Copilot CLI, you can use the --prompt-file option or pipe content via stdin, depending on your specific version and requirements. Using --prompt-file For large prompts or file contents, the recommended approach is to use the --prompt-file flag [1]. This method avoids issues with command-line argument length limits (such as ARG_MAX on Linux) that can occur when passing very large strings directly via the -p or --prompt option [1]. The Copilot CLI driver handles --prompt-file with size-aware logic [1]: - Files <= 100KB: The CLI reads the file contents and processes them as if they were passed via the standard -p option [1]. - Files > 100KB: The CLI passes a compact instruction to the agent, directing it to read and execute the prompt directly from the specified file path on disk [1]. Using Stdin You can also pipe content into the Copilot CLI using standard input (stdin) [2][3]. This is useful for scripting and avoiding complex shell escaping for multiline prompts [3]. Example usage: cat my_large_prompt.txt | copilot --stdin Note that while piping data to stdin is supported, behavior regarding the combination of stdin and specific flags (like --agent) has evolved in recent versions [3][4]. If you encounter issues with argument length when using -p, switching to --prompt-file or --stdin is the standard solution [1][3]. For programmatic automation, you can also use the -p or --prompt option for smaller, one-off requests [2][5]. However, for large inputs, always prefer --prompt-file to ensure stability [1].

Citations:


🏁 Script executed:

# Check the exact code at lines 161-173 in scripts/engine.sh
cat -n scripts/engine.sh | sed -n '155,180p'

Repository: petry-projects/.github-private

Length of output: 1297


🏁 Script executed:

# Search for copilot_chat function to understand full context
grep -n "copilot_chat" scripts/engine.sh | head -5

Repository: petry-projects/.github-private

Length of output: 431


🏁 Script executed:

# Look for usage of --yolo, --deny-tool flags mentioned in review
grep -n "\-\-yolo\|\-\-deny-tool" scripts/engine.sh | head -10

Repository: petry-projects/.github-private

Length of output: 786


ARG_MAX risk: prompt passed via -p instead of --prompt-file.

The comment (lines 161–164) acknowledges the ARG_MAX concern and mentions using a COPILOT_PROMPT environment variable, but the implementation reads the entire prompt file into a shell variable (line 166) and passes it via -p "$prompt_text" (line 173). This approach exposes the code to command-line argument length limits (typically ~2MB on Linux, less on macOS).

GitHub's official Copilot CLI documentation explicitly recommends using --prompt-file for large prompts, which handles size-aware logic internally: files ≤100KB are read inline, while larger files are processed by directing the agent to read from disk. The current implementation should use --prompt-file instead:

Recommended fix
- # Avoid ARG_MAX by using an env var for the prompt if possible, or attachment.
- # The Copilot CLI supports COPILOT_PROMPT env var as an alternative to -p.
- # (Assuming this in 2026 based on common patterns).
- # If not, we'll just use -p with the file content but very carefully.
- local prompt_text
- prompt_text=$(cat "$prompt_file")

  echo "    [copilot] calling gh copilot (model=$COPILOT_API_MODEL, timeout=${timeout_sec}s, flags=$*)" >&2

- # We use -p for the prompt.
  timeout "$timeout_sec" gh copilot \
    --model "$COPILOT_API_MODEL" \
-   -p "$prompt_text" \
+   --prompt-file "$prompt_file" \
    -s "$@"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/engine.sh` around lines 161 - 173, The current code reads the
prompt_file into prompt_text and passes it with -p (lines using prompt_text and
prompt_file), which risks ARG_MAX; change the gh copilot invocation in the block
that references COPILOT_API_MODEL and timeout_sec to call gh copilot
--prompt-file "$prompt_file" (remove the prompt_text="$(cat ...)" and the -p
"$prompt_text" usage), keeping the timeout "$timeout_sec" and other flags
intact; optionally preserve COPILOT_PROMPT support by exporting it earlier but
do not pass large prompt data via command-line arguments.

Comment thread scripts/review-one-pr.sh

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f02d03b910

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/engine.sh
# Stream directly to stdout; tee to OUTPUT_FILE when set.
if [ -n "${OUTPUT_FILE:-}" ]; then
copilot_chat "$prompt_file" "$DEEP_TIMEOUT_SEC" | tee "$OUTPUT_FILE"
copilot_chat "$prompt_file" "$DEEP_TIMEOUT_SEC" --yolo | tee "$OUTPUT_FILE"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve Copilot-written verdict files

When REVIEW_ENGINE=copilot reaches the agentic tiers, the prompts for deep/action runs tell the agent to write the verdict to $OUTPUT_FILE (for example prompts/cascade-action.md writes JSON there and then prints a status line, while explicitly saying not to print JSON). Piping Copilot stdout through tee "$OUTPUT_FILE" means that status/transcript output can truncate or overwrite the JSON the agent just wrote, so review-one-pr.sh later sees an invalid verdict and fails the review even though Copilot completed the task; keep stdout in the raw log only and let the agent-owned file remain untouched.

Useful? React with 👍 / 👎.

Comment thread scripts/engine.sh
copilot)
copilot_chat "$prompt_file" "$TRIAGE_TIMEOUT_SEC" || rc=$?
# In triage mode, we deny all tools to keep it fast and restricted.
copilot_chat "$prompt_file" "$TRIAGE_TIMEOUT_SEC" --deny-tool "*" || rc=$?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a valid Copilot tool-deny rule

When REVIEW_ENGINE=copilot is used for triage, this newly added --deny-tool "*" is passed directly to Copilot CLI; GitHub’s Copilot CLI docs describe --deny-tool=TOOL as denying a specific tool and state that wildcards are only supported for shell and URL filters, not as a catch-all tool name. In that Copilot primary/fallback path, triage can fail before producing JSON and be classified as a CLI invocation error instead of reviewing the PR; use documented deny entries such as read,write,shell,url or another supported no-tool mode.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf848d5cc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/engine.sh Outdated
ENGINE_SINGLE_MODEL="gpt-5.4"
# GitHub Copilot CLI model identifier. gpt-5.4 is a flagship model
# with full tool support in the Copilot CLI.
COPILOT_API_MODEL="${COPILOT_API_MODEL:-gpt-5.4}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Split the Copilot CLI model from REST preflight

When REVIEW_ENGINE=copilot, scripts/review-batch.sh still sources this value and sends it as the model in the GitHub Models REST smoke test before any gh copilot review runs; GitHub's Models REST docs require model IDs in {publisher}/{model_name} form such as openai/gpt-4.1, while this change makes the default a bare Copilot CLI alias. In that primary-Copilot configuration the batch can fail in preflight before reaching the new CLI path; use separate REST/CLI model variables or update the smoke test to exercise gh copilot instead.

Useful? React with 👍 / 👎.

Comment thread scripts/engine.sh
Comment on lines +172 to +174
timeout "$timeout_sec" gh copilot \
--model "$COPILOT_API_MODEL" \
-p "$prompt_text" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Smoke-test the same Copilot interface used here

In primary Copilot runs, this new path uses gh copilot, but I checked scripts/review-batch.sh and its preflight still calls the GitHub Models REST endpoint before this line can run. GitHub's REST docs say Models inference needs models: read, while the Copilot CLI docs say headless CLI auth can use a fine-grained PAT with only the Copilot Requests permission, so a token that is valid for the new CLI review path can still fail preflight and abort the batch. Point the smoke test at gh copilot (or skip the REST check) when using the CLI backend.

Useful? React with 👍 / 👎.

Comment thread scripts/engine.sh
Comment on lines +172 to +174
timeout "$timeout_sec" gh copilot \
--model "$COPILOT_API_MODEL" \
-p "$prompt_text" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invoke the standalone Copilot CLI for prompt mode

The new agentic path is using prompt-mode flags (-p, --yolo, --deny-tool, etc.), but the GitHub Copilot CLI docs show those flags on the standalone copilot command (for example copilot -p ...) while gh copilot is the GitHub CLI extension/builtin checked elsewhere in the workflows. In any Copilot primary or fallback run where only gh copilot is available, these prompt-mode arguments can be rejected before triage or writer work starts; install and call the standalone copilot CLI, or keep using the interface supported by gh copilot.

Useful? React with 👍 / 👎.

don-petry added a commit that referenced this pull request Jun 18, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Jun 21, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Jun 23, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Jun 23, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Jun 23, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 2, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 3, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 3, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 7, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 8, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 8, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 8, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
don-petry added a commit that referenced this pull request Aug 8, 2026
* fix(dev-lead): use heredoc for multiline environment variables

* fix(dev-lead): ensure all engines are installed and context is consistent

* fix(dev-lead): resolve stale model name in engine fallbacks

* fix(dev-lead): improve fallback reliability and script quality

- engine.sh: resolve stale model names in fallback loop; use -latest Gemini aliases
- dev-lead-fix-reviews.sh: remove unused code and fix PR_URL export

* fix(dev-lead): resolve Gemini model names and shell lint warnings

* security(dev-lead): use random heredoc delimiter to prevent injection

Also updates Gemini models to 3.1 family (pro/flash) for May 2026 compatibility.

* fix(dev-lead): update Gemini models to 2.5 stable family

* fix(dev-lead): use auto model selection for Gemini

* security(dev-lead): harden env var parsing and use high-quota Gemini fallback

* fix(dev-lead): use auto model for Gemini

* fix(pr-review): robust fallback for write ops and handle copilot 413

* fix(pr-review): optimize triage context size for copilot/low-token engines

* fix(pr-review): aggressively trim copilot triage context

* fix(pr-review): reduce copilot diff limit to 50 lines for triage

* feat(pr-review): self-sufficient agentic copilot with gpt-4o

* fix(pr-review): robust rate limit detection and triage debugging

* debug(pr-review): verbose copilot chat logging

* feat(pr-review): switch copilot to agentic gpt-5.4 and ensure non-interactivity

* fix(pr-review): ensure COPILOT_API_MODEL is always bound and valid

* fix(dev-lead): correct author_association for comment events
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.

2 participants