Skip to content

fix(providers): discover and route new models - #143

Merged
mudler merged 8 commits into
masterfrom
fix/provider-model-refresh
Oct 12, 2026
Merged

mudler merged 8 commits into
masterfrom
fix/provider-model-refresh

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

Summary

New model IDs can appear before nib's bundled metadata catches up. Incomplete discovery results can also reject valid selections.

  • Refresh the model catalog from pinned upstream revision c8913466dd7bf92040de911f8e00e30b8f4e48a2, with validated provenance and reproducible generation.
  • Repair repeated catalog updates with an owned automation branch and a pinned PR-update action.
  • Query Codex app-server model/list, including pagination, cancellation, and process cleanup, instead of returning only the configured model.
  • Preserve partial discovery results and diagnostics across Anthropic, Google, Vertex, and Bedrock. Refresh conservative Gemini suggestions.
  • Keep stored vendor credentials away from custom native endpoints. Do not add vendor suggestions to custom Vertex endpoints.
  • Route Copilot requests using advertised endpoints. Respect explicit reasoning-summary capabilities and exact official-route catalog metadata.
  • Use route-specific context metadata after explicit settings and live provider limits. Reject stale overflow limits after provider switches.
  • Add /model --unlisted <exact-id> for explicit, unverified selection without weakening normal validation.

Catalog entries and successful discovery do not establish account access. This PR does not change the default model or Codex compatibility version.

Why this is a draft

Native Claude adaptive/manual thinking and reasoning-configuration integration remain blocked and are not implemented here.

The pinned cogito message representation cannot preserve native signed/redacted thinking across the complete tool lifecycle. Local fake-server tests through the actual loop show:

  • Signed and unsigned responses become indistinguishable reconstructed histories.
  • Tool arguments are reconstructed, including lossy numeric conversion.
  • Correction retries can discard one tool call and replace another call's arguments.

A same-instance cache might support a narrower normal path. It does not establish safe replay after correction, adapter recreation, or resume. This PR deliberately adds no such cache and does not enable unsafe partial thinking support. Completing that scope requires a lossless message carrier and separate lifecycle tests.

The catalog already contains newer Claude metadata; native model discovery remains dynamic. Neither implies the missing thinking capability works.

Verification

Passed locally:

go test ./...
go test -race ./codexapp ./llmprovider/... ./chat -count=1
go test ./cmd -count=1
python3 .github/tests/test_catalog_workflow.py
cmp README.md selfdoc/README.md
git diff --check origin/master...HEAD

Additional focused regression and race tests cover selection, endpoint isolation, protocol routing, pagination, cancellation, and stale context learning. Two generations from the pinned catalog source produce identical artifact and provenance hashes.

The catalog workflow tests are offline contract checks plus inspection of the pinned action, not live GitHub workflow execution. No real-provider inference, account-access test, or CLI installation was performed.

Public references

Pin upstream metadata and record its digest so ordinary generation cannot
silently refresh from a moving branch. Validate source records before
replacing outputs and roll back the artifact if provenance replacement fails.

Refresh the embedded metadata and cover provider-specific limits. Use a
pinned PR updater on a reserved branch so repeated automation stays safe.
Document reproduction, refresh, recovery, and metadata limitations.
List Codex app-server models without starting an inference turn.
Keep collected native model IDs with per-call completeness and errors,
so a later page or source failure does not discard useful results.

Refresh conservative Gemini chat hints from the pinned catalog.
Cover discovery failures and session propagation with local fixtures.
Custom native endpoints must not inherit stored vendor logins or ambient
keys. Resolve only explicit keys for overrides while preserving normal
authentication at registered provider endpoints.

Keep Vertex catalog suggestions off custom API-key endpoints. Cover
credential isolation and per-call discovery completeness with local
fixtures, and document these endpoint boundaries.
Discover capabilities on the completion adapter before choosing a protocol.
Explicit endpoints override model-name heuristics, including future IDs.
Keep the previous routing when discovery is unavailable or lacks metadata.

Bound the adapter-local cache by identity, size, and expiry. Do not retry
failed inference requests on another protocol. Cover lazy discovery,
cache isolation, cancellation, and protocol failures with fake servers.
Pass Copilot summary capabilities to the shared Responses translator.
Explicit false overrides catalog defaults and model-name heuristics.

Restrict catalog fallback to exact models on known official routes.
Preserve legacy summary exclusions and pass reasoning efforts unchanged.
Cover GPT-6 catalog entries, custom endpoints, and picker independence.
Use exact official catalog context before legacy or generic defaults.
Keep explicit settings and provider-reported current limits authoritative.
Custom endpoints and Azure aliases must not inherit vendor limits by name.

Clear learned limits atomically when switching models or providers, even
when both endpoints use the same model ID. Cover cold starts, route
isolation, overrides and switching with offline regression tests.
An old turn can report overflow after a same-name provider switch.
Scope learned windows to the provider generation captured with its client
so the old endpoint cannot overwrite the new endpoint's limits.

Add synchronized regression tests for context and budget overflow,
including same-generation learning.
Let users select exact IDs absent from endpoint listings without making
ordinary model selection permissive. Mark explicit selections unverified;
the provider decides whether the model is usable.

Share parsing across the REPL and TUI, and reject canceled switches before
mutation. Preserve advertised lists and child-model allowlists. Document
the override and test selection without inference probes.
@mudler
mudler merged commit 386c363 into master Oct 12, 2026
2 checks passed
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.

2 participants