Skip to content

refactor(config): built-in provider kinds and patches come from the table (ENG-1066) - #373

Merged
lg2m merged 1 commit into
mainfrom
refactor/eng-1066-ap7c-builtin-patch
Oct 20, 2026
Merged

lg2m merged 1 commit into
mainfrom
refactor/eng-1066-ap7c-builtin-patch

Conversation

@lg2m

@lg2m lg2m commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Slice AP7c, which finishes AP7 of the auth-providers plan (ENG-1066), after #368 and #372.

What changed

No user-visible change. Two things still had a variant per provider; they now come from the provider table:

  • ProviderKind: the five built-in variants become ProviderKind::Builtin(BuiltinProvider), with name(), builtin() and discovery(). qq config prints kind.name(), the same strings as before.
  • ProviderEntryPatch: the five built-in variants become one Builtin patch (ADR-0064 §2). Hand-written serde maps the row's config_name (OpenAi, OpenAiCodex, …) to the row and accepts only the row's patch_fields. Anything else is an unknown field error, as under deny_unknown_fields. Serialisation writes the same externally tagged struct variant, field order and skipped fields as before. Other kinds keep a derived enum, replayed through EnumAccess.
  • Model discovery reads the row's ModelDiscoveryShape (Supplementary, Authoritative, Codex) instead of matching OpenAiCodex | Anthropic. API-key headers and pagination follow the protocol, which is how every built-in already behaved.
  • The compiled defaults iterate the table.

Each row now carries the RON variant name, accepted patch fields and discovery shape. Adding an API-key preset is one table row plus its BuiltinCatalog (and docs and canary entries). There is no new ProviderKind or patch variant, and no new match arm.

Verification

  • builtin_provider_patches_keep_their_trust_digests now pins 13 documents: the 9 built-in shapes from refactor(config,cli): drive built-in HTTP providers from one table (ENG-1066) #368 plus LiteLLM, Bedrock, Mantle and Custom. The 4 new digests were recorded on unmodified origin/main before the change. All are byte-identical afterwards, so trusted project files stay trusted.
  • builtin_provider_patches_reject_fields_they_do_not_have and builtin_provider_patches_layer_over_their_presets pass unchanged, apart from comparing kind.name().
  • New table test every_row_has_a_unique_config_name_and_known_patch_fields.
  • cargo xtask check passed; cargo xtask smoke 9/9.

Notes

  • The in-memory discovery cache key (a per-process HMAC, never persisted) hashes kind.name() instead of the enum discriminant.
  • cache_identity_separates_effective_credentials used to tell API key from bearer only through ProviderKind::Anthropic on an OpenAI route. It now uses an Anthropic Messages route, where the header actually differs.
  • xtask/src/legacy-sleeps.txt: 5 existing entries moved 12 lines; no new sleeps.

…able (ENG-1066)

ProviderKind's five built-in variants become ProviderKind::Builtin(row),
and ProviderEntryPatch's become one Builtin patch parsed and serialised by
the row's variant name and accepted fields (ADR-0064 §2). Model discovery
reads the row's discovery shape instead of matching provider kinds.

Trust digests of every patch shape are pinned to the bytes recorded
before the change, now including LiteLLM, Bedrock, Mantle and Custom.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T05:03:06.980235Z 5fb49f6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lg2m

lg2m commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 5fb49f6ecd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lg2m
lg2m merged commit 3d8bd7a into main Oct 20, 2026
6 checks passed
@lg2m
lg2m deleted the refactor/eng-1066-ap7c-builtin-patch branch October 20, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant