Conversation
Make connection:v1:test-active and test-provider share active-provider resolution, auth/headers, canonical baseUrl, wire, and keyless/OAuth rules with generate. Probe the real inference endpoint and treat GET /models as optional discovery, with structured diverges results when the host is reachable but invoke would fail. Fixes OpenCoworkAI#216 Signed-off-by: Xuanrui Li <xuanrui.li@se24.qmul.ac.uk>
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
Connection tests (
connection:v1:test-active/connection:v1:test-provider) now validate the same effective provider contract thatgenerateuses, instead of treating aGET /models200 as Connection OK.Fixes #216 (slice of epic #214). Does not implement sibling #213.
Shared contract
resolveEffectiveInvokeContract()inapps/desktop/src/main/effective-provider-contract.tsis the single resolver for:resolveActiveModel()snap-to-config as generate (stale rendererprovideris ignored whencfg.activeProvideris set)resolveProviderModel) with no snap to the active slotresolveCredentialForProvider()— ChatGPT Codex usesgetValidAccessToken(), other providers share the same API-key / env / keyless rules as generateAuthorization: Bearervsx-api-keyfromauthHeaderNameForProvider()baseUrl:canonicalInvokeBaseUrl()(trailing slash +/v1for OpenAI-compatible wires)invokeUrlForWire()— Codex Responses vs Anthropic messages vs OpenAI chat completionsallowKeylessis trueGenerate and memory IPC now pass that canonical baseUrl into
complete(), andcomplete()canonicalizes once more so runtime cannot silently diverge./modelsvs real wiremodelsProbeRelationForWire()inpackages/shared:GET /modelsis not the generate contract. Generate never calls it. A 200 on/modelsis not Connection OK./modelsprobe; OAuth token resolution is the test.Probe both discovery and inference when discovery is optional:
/modelsok: true,compatibility: 'degraded',invokeParity: 'degraded-discovery'ok: false,compatibility: 'diverges',code: 'INVOKE_DIVERGED'ok: true,compatibility: 'compatible'ok: falsewith invoke errorRenderer toasts distinguish success / degraded discovery / reachable but diverges from real invoke / hard failure.
Tests
tokenStore.read()/chat/completions, not/responses/models200 + invoke 404 → diverges (test must not pass when runtime would fail)/models404 + invoke 200 → degraded pass (test must not fail when runtime would succeed)/chat/completionsPrinciples 5b
schemaVersionunchanged; new result fields are optional for older renderersConstraints
fetchagainst the same URLscomplete()uses