Skip to content

fix(routing): retain displaced primary in colliding fallback chains - #4064

Open
PeterDaveHello wants to merge 1 commit into
The-PR-Agent:mainfrom
PeterDaveHello:chore/default-model-gpt-6-series
Open

PeterDaveHello wants to merge 1 commit into
The-PR-Agent:mainfrom
PeterDaveHello:chore/default-model-gpt-6-series

Conversation

@PeterDaveHello

@PeterDaveHello PeterDaveHello commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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 in config.fallback_models. Previously this retried that endpoint and discarded the configured primary; the duplicate pair also prevented /improve from 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

flowchart LR
  defaults["Sol primary and Luna fallback"]
  routing["Optional primary model routing"]
  repair["Deduplicate colliding endpoints and retain displaced primary"]
  retries["Fallback retries and failed-chunk recovery"]
  defaults --> routing
  routing -- "Fallback endpoint collision" --> repair
  repair --> retries
  routing -- "No collision: unchanged fallbacks" --> retries
Loading

File Walkthrough

Relevant files
Bug fix
1 files
pr_processing.py
Repair routed endpoint collisions and preserve displaced primary
+11/-7   
Tests
3 files
test_model_routing.py
Verify collision recovery, endpoint ordering, and context restoration
+67/-1   
test_per_directory_settings.py
Verify nested settings preserve explicitly configured root fallbacks
+5/-2     
test_suggestion_chunk_recovery.py
Test deployment-aware recovery and routed collision chunk retries
+34/-0   
Documentation
2 files
changing_a_model.md
Explain routed fallback collisions and update model examples
+25/-5   
configuration_reference.md
Update model defaults and document endpoint collision handling
+3/-3     
Configuration changes
1 files
configuration.toml
Set GPT-6 defaults and explain routed retry behavior         
+5/-5     


⚙️ Agent run details
  • Model: openai/gpt-6.1-sol
  • Tokens: 9,550 in / 452 out / 10,002 total
  • Time cost: 8.2s
  • AI calls: 1

Copilot AI balanced review requested due to automatic review settings October 11, 2026 09:29
@github-actions github-actions Bot added the chore label Oct 11, 2026
@the-pr-agent-bot

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.


⚙️ Agent run details
  • Model: openai/gpt-6.1-sol
  • Tokens: 9,457 in / 72 out / 9,529 total
  • Time cost: 6.0s
  • AI calls: 1

Copilot AI 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.

🟡 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.

Comment thread pr_agent/algo/pr_processing.py

Copilot AI 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.

🟢 Approval recommended

The fallback repair matches the documented behavior and has comprehensive regression coverage.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.
@PeterDaveHello
PeterDaveHello force-pushed the chore/default-model-gpt-6-series branch from d8ea7a0 to ac21479 Compare October 11, 2026 18:37
@PeterDaveHello PeterDaveHello changed the title chore(models): use GPT-6 defaults and repair routed fallback collisions fix(routing): retain displaced primary in colliding fallback chains Oct 11, 2026
@PeterDaveHello

Copy link
Copy Markdown
Contributor Author

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).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants