add multi-provider model diversity to adversarial pr review (closes #2)#3
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for running adversarial PR review passes across multiple LLM providers/models, enabling per-pass model diversity via a new review_models: configuration and AMQP passthrough.
Changes:
- Extend lifecycle runner to accept
review_models:and build per-pass model/provider assignments, skipping unavailable providers. - Update
PullRequestReviewerto acceptmodel:/provider:kwargs and forward them toLegion::LLM.chat. - Forward
review_modelsthroughLifecycleSubscriber, update specs, bump version, and document the release.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/legion/extensions/swarm_github/runners/extension_lifecycle.rb | Adds settings fallback for review models and per-pass assignment logic for adversarial reviews. |
| lib/legion/extensions/swarm_github/runners/pull_request_reviewer.rb | Accepts model:/provider: and conditionally forwards them to Legion::LLM.chat. |
| lib/legion/extensions/swarm_github/actors/lifecycle_subscriber.rb | Forwards review_models from the lifecycle payload into run_lifecycle. |
| spec/legion/extensions/swarm_github/runners/extension_lifecycle_spec.rb | Adds coverage for forwarding and assignment helper behavior. |
| spec/legion/extensions/swarm_github/runners/pull_request_reviewer_spec.rb | Adds coverage asserting model/provider forwarding/omission. |
| spec/legion/extensions/swarm_github/actors/lifecycle_subscriber_spec.rb | Adds coverage for review_models passthrough. |
| lib/legion/extensions/swarm_github/version.rb | Bumps gem version to 0.3.2. |
| CHANGELOG.md | Documents the new multi-provider review behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…t downstream typing
change build_model_assignments to use each available spec at most once then backfill remaining slots with nil (default provider), instead of cycling; update spec to match new use-once-then-nil semantics
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- add Array type guard in build_model_assignments with log.warn for non-Array input - add extend self to PullRequestReviewer so module-level call in run_adversarial_review works - stub pr_reviewer_available? in integration contexts that don't exercise adversarial review path - add spec coverage for non-Array models guard
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
move is_a?(Array) guard before models.empty? to avoid NoMethodError on non-Array types; add spec coverage for Hash and Integer inputs (#3)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
guard non-symbolizable provider values in build_model_assignments (#3)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assignments = available.first(count) | ||
| assignments + Array.new([count - assignments.length, 0].max) { nil } | ||
| end |
There was a problem hiding this comment.
The PR description/test plan mentions remaining K slots being backfilled via cyclic assignment, but build_model_assignments uses each available spec at most once and then backfills with nil (default provider). Please align the PR description (or adjust the implementation) so they match.
Summary
review_models:kwarg torun_lifecyclefor per-review provider/model cyclingPullRequestReviewernow acceptsmodel:andprovider:kwargs, forwarded toLegion::LLM.chatLifecycleSubscriberforwardsreview_models:from AMQP payloadcodegen.self_generate.github.review_modelsTest plan