Repository navigation
refactor(providers): land the three Phase 8 conformance preconditions - #1105
Merged
Merged
Conversation
Part of #860 (Phase 8), closing the preconditions recorded in #974: - optional_api_key discovery cells now derive auth: 'optional' and the generated matrix executes both credential branches (configured key reaches the wire; absent key sends no credential at all). - Override cells now bind to executable runs in provider-contract-overrides.ts that the matrix suite executes directly, replacing the textual test-title source check; the bound hand-written tests moved out of provider-conformance.test.ts / model-fetcher.test.ts so each contract runs exactly once. - The /^gpt-5/i Responses routing regex is lifted into the openAiAdapterApiProtocol declaration in core (ModelInfo.apiProtocol seam); runtime model-factory and the matrix sample-id derivation both consume the declaration, with a wire test locking gpt-5*->Responses and other ids->Chat Completions.
57 tasks done
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
Part of #860 (Phase 8). Lands the three Phase 8 preconditions recorded when #974 merged, so the overlapping hand-written conformance coverage can be consolidated in a follow-up without losing any contract:
Per-cell credential cases for
optional_api_keydiscovery. The matrix plan now derivesauth: 'optional'foroptional_api_keyproviders (LocalAI), alongside'default'and'none'. The generated discovery executor expandsoptionalinto two executed branches: a configured key must reach the wire asAuthorization: Bearer …, and an absent key must leave the request completely credential-free (no dummy value).'none'(Ollama, LM Studio, public lists) keeps asserting that no credential header is ever sent.Executable override bindings replace the textual title check. Override cells now bind to runnable entries in
packages/runtime/src/__tests__/provider-contract-overrides.ts, and the matrix suite executes each binding directly as a test. The previous mechanism asserted that a bound test title existed as an enabledtest(...)call in another source file — a textual check that a fully commented-out test could still satisfy. The bound hand-written tests (GitHub Copilot discovery + subscription wire, Fireworks pagination discovery, Ollama/api/tagsdiscovery, Cohere native V2 pagination, ZenMux streamed signed-reasoning replay) moved verbatim out ofprovider-conformance.test.ts/model-fetcher.test.tsinto the bindings module, so each contract executes exactly once and deleting or breaking an override fails the matrix instead of leaving a silent gap. Shared scripted-HTTP plumbing moved toconformance-harness.ts.apiProtocoldeclaration lift retires the/^gpt-5/irouting regex in runtime. The OpenAI-adapter protocol split is now declared once in core asopenAiAdapterApiProtocol()(documented against the existingModelInfo.apiProtocolseam).model-factoryroutes by the connection's stored per-modelapiProtocolwhen present (account-advertised wire, same as the GitHub Copilot case) and otherwise by the core declaration; the matrix's sample-model-id derivation consumes the same declaration instead of duplicating the regex. Behavior is unchanged:gpt-5*still goes to the Responses API, everything else to Chat Completions, now locked by a wire test.Verification
npm run typecheck— all workspaces pass.npm run test:scripts— 109/109 pass.@maka/core1066 pass,@maka/storage286 pass (1 skipped),@maka/runtime1973 pass (7 skipped/todo),@maka/headless1022 pass (1 skipped),maka-agent(CLI) 412 pass,@maka/desktop2571 pass — 0 failures everywhere.npm run check:stale— dist is fresh;git diff --checkclean.optionalderivation (localai), both LocalAI credential branches, and OpenAI gpt-5*/other wire routing.Review focus
getAIModel'sopenaicase now consultsconnection.models[].apiProtocolfirst. No current discovery path storesapiProtocolfor theopenaiprovider type, so this is behavior-preserving today; it exists so an account-advertised wire wins over the static declaration, mirroring the GitHub Copilot case.