Repository navigation
🤖 refactor: move per-provider Coder catalog merge rules into a tested module - #6305
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CoderOauthService.refreshBridgeModelsSerializedEffectdecides, inside the providers-file lock, what each AI Gateway provider contributes to the next model catalog write. Those per-provider rules (carry-forward, type gating, conclusiveness) and the read of the prior catalog state now live insrc/node/services/coderGatewayCatalogMerge.ts, with direct unit tests. Behavior is unchanged.Background
This PR is part of the CRAP campaign on
src/node/services/coderOauthService.ts. CRAP = CC² × (1 − coverage)³ + CC.refreshBridgeModelsSerializedEffectreconcileProviderCatalog(new)readPriorCoderCatalog(new)stringEntries(new)idsUnderProvider(new)Scoring method:
make crapwith the 9 CIcrap-lcov-*reports of PR run 38364731596 plus a local lcov ofcoderOauthService.test.tsand the new test file (bun test --coverage). With it,refreshBridgeModelsSerializedEffectgoes from CRAP 54 to 30, and no function in the file is above 30.make crap-checkwith that coverage: PASS, 0 violations, 1 warning (reconcileProviderCatalogCC 18, move relief: the kept function lost CC 24, the new functions hold 22 decision points).Note: CI's Quality / CRAP shows this file at about 0% coverage, because
scripts/test-unit-ci.shrunscoderOauthService.test.tsas an isolated file without--coverage. The new test file runs in the shared shards, so CI does see its coverage.Implementation
readPriorCoderCatalog(section)returns the prior catalog markers (known,discovered,stale,providers). It reads the same fields with the same string filter as before.reconcileProviderCatalog(provider, result, prior, authoritative)returns one provider's contribution: the model IDs, the provider metadata to persist on the probe path (zero or one entry), and whether it makes the catalog inconclusive. Each branch and its comment moved verbatim from the loop body.catalogInconclusiveis true when any provider is inconclusive.updateProviderSectioncalls the mutation once, so assigning the flag instead of only setting it to true changes nothing.Validation
coderGatewayCatalogMerge.test.ts(16 cases) covers the marker parsing and every ok / error / unavailable branch, on the listing and the probe path, including type changes and the name-as-type default.coderOauthService.test.tspasses unchanged (101 tests).Risks
Low. The change is a pure move of catalog merge rules behind the same lock. A mistake would show as a wrong catalog after a refresh (models missing or carried forward wrongly). The existing service tests for those flows pass unchanged.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high