Repository navigation
feat: implement issue #881 — pr-review engine: COPILOT_API_MODEL unbound var silently disables the cross-engine rubber-duck tier (engine.sh:431) - #894
Conversation
…bound var silently disables the cross-engine rubber-duck tier (engine.sh:431)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesCOPILOT_API_MODEL unconditional default fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Code Review
This pull request moves the default initialization of COPILOT_API_MODEL in scripts/engine.sh to be unconditional, ensuring it is always set even when Copilot is not the primary engine. This prevents unbound variable errors under set -u during cross-engine rubber-duck execution. A new suite of bats regression tests has been added to verify this behavior. Feedback is provided to correct a minor typo with unbalanced parentheses in the newly added comments.
Dev-Lead — review-changes (applied)Changes committed and pushed. |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T14:23:38Z. |
Dev-Lead — fix-reviews (no-changes)Agent reasoning |
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #894 |
|
Note @don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically. |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T16:05:28Z. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: 44347541a4ced17e68a669b3fa2acbf0241e9f46
Review mode: triage-approved (single reviewer)
Summary
Hoists the COPILOT_API_MODEL default out of the copilot) branch of set_engine_config() to an unconditional block after the case statement, so the variable is always bound for the cross-engine rubber-duck path. Adds a Bats regression suite covering claude/copilot/gemini primaries plus a set -euo pipefail subprocess test. +71/-7 across 2 files.
Linked issue analysis
Closes #881. Verified the root cause holds: the claude) branch sets DUCK_ENGINE=copilot (engine.sh:93) and copilot_chat references a bare $COPILOT_API_MODEL (engine.sh:455,460) under set -u, so leaving the default inside the copilot-only branch aborted the duck subprocess on a claude-primary review and silently skipped tier-2. The fix defaults it unconditionally (engine.sh:176) and it remains exported (engine.sh:181: export DUCK_ENGINE DUCK_MODEL COPILOT_API_MODEL). Both fixes requested in the issue — unconditional default + regression tests — are implemented and scoped.
Findings
No blocking findings. The change is minimal, behavior-preserving for the copilot-primary case (regression test confirms), and adds explicit coverage for the previously-broken claude/gemini paths. Non-blocking nit (pre-existing, not introduced here): the comment at engine.sh:434 says 'default: openai/gpt-4o' while the actual default is openai/o4-mini — worth aligning in a future touch. No auth/secrets/migration/CI-security concerns. Secret-scanning MCP tool not exposed in this environment; relied on the passing gitleaks CI check instead.
CI status
All required checks green (shellcheck, ShellCheck, bats, unit, unit-tests, CodeQL, Analyze (actions/python), agent-shield, gitleaks secret scan, SonarCloud quality gate passed with 0 new issues). Skipped checks are dependabot/dependency-audit stubs (expected). CodeRabbit reported no actionable comments. mergeStateStatus is BLOCKED only on the required human/automated review (REVIEW_REQUIRED), which this verdict addresses.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
|
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T17:37:18Z. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: a419c991371d5d71cf1b4ab7b17fc2912742aa23
Review mode: triage-approved (single reviewer)
Summary
Small, well-scoped fix for #881: moves the COPILOT_API_MODEL default assignment out of the copilot-only case branch to an unconditional default after the case statement (engine.sh:176), and keeps it exported (engine.sh:181). This resolves the unbound-variable abort under set -u when a non-copilot primary (e.g. claude, which wires DUCK_ENGINE=copilot at engine.sh:93) invokes copilot_chat's bare $COPILOT_API_MODEL (engine.sh:455/460) for the cross-engine rubber-duck tier. Adds 5 bats regression tests covering claude/copilot/gemini primaries, set -u reproduction, and override honoring.
Linked issue analysis
#881 reports that COPILOT_API_MODEL was defaulted only inside the copilot) branch, so under claude-primary reviews the duck subprocess silently aborted and tier-2 was skipped. The fix directly addresses the root cause: the default is now applied for every engine and exported unconditionally (an improvement over the prior copilot-only export). Verified the claim against source — claude branch sets DUCK_ENGINE=copilot (engine.sh:93) and copilot_chat references a bare $COPILOT_API_MODEL (engine.sh:455/460). Substantively addressed.
Findings
No blocking findings. Non-blocking nit (from gemini-code-assist): the explanatory comment uses "claude) branch" shorthand which reads as an unbalanced paren; it intentionally refers to the claude) case label and is harmless. No secrets — COPILOT_API_MODEL is a public model identifier, not a credential. Export is preserved (engine.sh:181), so no regression in subprocess visibility. shellcheck SC2015/SC1091 infos at engine.sh:281 are pre-existing and outside this diff.
CI status
All required checks green (Lint, shellcheck/ShellCheck, unit-tests/unit, bats, CodeQL, Analyze actions+python, SonarCloud, agent-shield, holdout-guard, validate-fixtures, guard, secret scan gitleaks, plus structure/permission guards). CANCELLED entries are the dev-lead agent's own dispatch/ci-relay workflows; SKIPPED entries are dependency-audit jobs for ecosystems not present. reviewDecision=APPROVED (coderabbitai, donpetry-bot at prior SHA). Local bats unavailable on runner; relied on CI's green bats/unit checks.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.



Closes #881
Implemented by dev-lead agent. Please review.
Summary by CodeRabbit
Bug Fixes
Tests