Repository navigation
fix(routing): retain displaced primary in colliding fallback chains - #4064
PeterDaveHello wants to merge 1 commit into
Conversation
PR Code Suggestions ✨No code suggestions found for the PR. ⚙️ Agent run details
|
There was a problem hiding this comment.
🟡 Changes recommended
Empty deployment IDs can bypass collision repair and omit the displaced primary.
1 open finding
What changed in this PR
Updates default models to GPT-6 and repairs fallback-chain collisions during model routing.
Changes:
- Sets GPT-6.1 Sol as primary and GPT-6 Luna as fallback.
- Deduplicates routed fallback endpoints while retaining the displaced primary.
- Expands routing, chunk-recovery, deployment, and configuration tests/docs.
| File | Description |
|---|---|
pr_agent/algo/pr_processing.py |
Builds the repaired effective fallback chain. |
pr_agent/settings/configuration.toml |
Updates model defaults and routing guidance. |
docs/docs/usage-guide/changing_a_model.md |
Documents GPT-6 routing and collision behavior. |
docs/docs/usage-guide/configuration_reference.md |
Reflects updated configuration defaults. |
tests/unittest/test_model_routing.py |
Tests fallback-chain collision handling. |
tests/unittest/test_suggestion_chunk_recovery.py |
Tests /improve recovery through the repaired chain. |
tests/unittest/test_per_directory_settings.py |
Verifies root fallback settings remain authoritative. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks for repairing the routed fallback collision. Verified: with the shipped fallback and the documented example rule, main retries the same endpoint twice and never reaches the configured primary, and /improve chunk recovery is skipped for the same reason; the repaired chain holds, and the new tests fail against main's pr_processing.py.
One ask: split the collision repair from the default-model change. The repair is a bug fix I would take into 0.48.0 now. Moving config.model and config.fallback_models to gpt-6.1-sol / gpt-6-luna changes behaviour for every install that does not pin a model, gpt-5.6 is still live, and the PR carries no benchmark or model-page reference as #2535 did. That part wants its own PR with the rationale, after the release.
A routed endpoint already in the fallback list was retried without reaching the configured primary, also disabling failed-chunk recovery. Deduplicate only colliding endpoint pairs and retain the displaced primary without changing other chains or configured model defaults.
d8ea7a0 to
ac21479
Compare
|
Thanks for verifying the collision fix. Split as requested: this PR now contains only the routed fallback collision repair, regression tests, and its documentation. The shipped GPT-5.6 primary and GPT-5.6 Terra fallback, commented model settings, and routing-example model IDs are unchanged. It is rebased onto current main and consolidated into one commit. The GPT-6 default-model change is being handled separately, with its rationale and model references, rather than being included in this release fix. Following up on #4064 (review). |

User description
Repair routed fallback collisions without changing the shipped model defaults or runtime configuration values.
A routing rule can select the same
(model, deployment)endpoint already listed inconfig.fallback_models. Previously this retried that endpoint and discarded the configured primary; the duplicate pair also prevented/improvefrom recovering failed chunks with the configured primary.When a routed endpoint collides with a configured fallback, normalize absent deployment IDs for comparison, deduplicate complete endpoint pairs in stable order, and retain the displaced primary. Append it only when absent; if it is already in the chain, preserve its position. Distinct deployments remain distinct endpoints. Unrouted and noncolliding chains retain their original values and order, and the caller's raw deployment setting is restored.
Tests cover successful first attempts, eligible failures, exhausted chains, non-fallback errors, missing/empty deployment IDs, endpoint order, context restoration, and parallel/sequential recovery of only failed chunks. The documentation and generated reference describe the collision behavior using the existing GPT-5.6 defaults and routing examples.
The GPT-6 default-model change has been removed from this PR and is being handled separately.
Any retained bot-generated text describing GPT-6 defaults summarizes the earlier mixed scope and is superseded by this current scope.
PR Type
Bug fix, Enhancement, Tests, Documentation
Description
Adopt GPT-6.1 Sol defaults with Luna fallback.
Repair routed collisions while preserving distinct deployments.
Test fallback ordering, context restoration, chunk recovery.
Document routing retries and updated model examples.
Diagram Walkthrough
File Walkthrough
1 files
Repair routed endpoint collisions and preserve displaced primary3 files
Verify collision recovery, endpoint ordering, and context restorationVerify nested settings preserve explicitly configured root fallbacksTest deployment-aware recovery and routed collision chunk retries2 files
Explain routed fallback collisions and update model examplesUpdate model defaults and document endpoint collision handling1 files
Set GPT-6 defaults and explain routed retry behavior⚙️ Agent run details