Repository navigation
feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) - #556
Conversation
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 35 minutes and 39 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 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 introduces intent-based model dispatching and provider headroom checks to optimize engine selection and prevent rate-limiting issues. It adds helper functions model_for_intent and check_provider_headroom in scripts/engine.sh, updates the dev-lead scripts to pass intent types, and includes comprehensive unit tests. The review feedback highlights several robustness improvements in scripts/engine.sh, including validating that rate-limit values are numeric to prevent crashes under set -eu, avoiding the curl -sI -X POST anti-pattern, and parsing HTTP headers more reliably by handling potential whitespace variations.
Dev-Lead — review-changes (applied)Changes committed and pushed. |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #195 by making the dev-lead “writer” path actually use the multi-tier model configuration in engine.sh, and by improving provider fallback behavior with a proactive headroom check before invoking an engine.
Changes:
- Add intent-based model selection (
model_for_intent) and plumb intent throughrun_writer_with_fallback, so different dev-lead tasks can use different tier models. - Add
check_provider_headroomand integrate it into the fallback loop to proactively skip engines near quota exhaustion. - Add new Bats unit tests covering model dispatch and provider headroom behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/engine.sh |
Adds intent→model mapping and provider headroom probing; updates run_writer_with_fallback to select tier model per intent and engine. |
scripts/dev-lead-fix-reviews.sh |
Passes INTENT_TYPE into run_writer_with_fallback so model selection matches the invoked intent. |
scripts/dev-lead-fix-issue.sh |
Passes explicit fix-issue intent into run_writer_with_fallback. |
scripts/dev-lead-fix-ci.sh |
Passes explicit fix-ci intent into run_writer_with_fallback. |
tests/dev-lead/unit/test_provider_headroom.bats |
Adds unit tests for check_provider_headroom and for headroom-driven fallback skipping. |
tests/dev-lead/unit/test_model_dispatch.bats |
Adds unit tests for model_for_intent and intent-based model selection through run_writer_with_fallback. |
Dev-Lead — review-changes (applied)Changes committed and pushed. |
Dev-Lead — waiting on PR blockers (intent: fix-reviews)PR: #556 |
|
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…ier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) (#556) * feat: implement issue #195 — bug(dev-lead): engine.sh defines multi-tier model pipeline but all tasks always invoke ENGINE_ACTION_MODEL (sonnet-4-6) * chore: apply manual instructions [skip ci-relay] * chore: apply manual instructions [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>



Closes #195
Implemented by dev-lead agent. Please review.