Repository navigation
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>
Owner
Author
|
Superseded by the upstream PR: OpenCoworkAI#421 ( |
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 testing was a separate
/modelsprobe, so it could pass whengeneratewould fail (wrong wire/auth/baseUrl) or fail whengeneratewould work (/modelsmissing). This PR extracts a shared effective invoke contract and makesconnection:v1:test-active/connection:v1:test-providera low-cost validation of that same contract.test-activeusesresolveActiveModel()(including snap-to-canonical-active) plusresolveCredentialForProvider()— the same path as generate, including ChatGPT CodexgetValidAccessToken()refresh.test-providerresolves the named provider with the same auth, header, canonicalbaseUrl, wire, and keyless rules./modelsis defined as optional discovery. Runtime generate never calls it. Missing/models+ working inference isdegraded/degraded-discovery./modelssuccess + failed inference isok: falsewithcompatibility: "diverges"so the renderer can tell “reachable but not the real invoke path”.complete()now canonicalizebaseUrlwith the same helper the connection test uses.Type of change
Linked issue
Fixes OpenCoworkAI#216
Refs OpenCoworkAI#214
Does not implement sibling OpenCoworkAI#213 (capability-aware diagnostics beyond invoke-parity).
Checklist
pnpm lint && pnpm typecheck && pnpm testpasses locally (pre-push hook: typecheck + lint + full unit suite)pnpm changeset) if user-visiblePrinciples 5b
ok/probeMethod/compatibilityfields remain; newinvokeParity,invokeContract, anddivergesare additive.resolveEffectiveInvokeContract+inferenceEndpointUrlinstead of parallel credential/URL logic.Tests
Regression coverage includes:
/models200 with a dead invoke URL (including openai-responses vs chat-only gateway) reportscompatibility: "diverges"instead of Connection OK./models404 with working/chat/completionsstill reports degraded success (degraded-discovery).getValidAccessToken, no/modelsHTTP probe), keyless proxy (empty bearer), OpenAI-compatible gateway (canonical/v1+ Bearer).Screenshots / recordings (UI changes)
Settings now uses structured toasts: success, degraded-info, and a distinct “reachable but generate would fail” error. No layout change; not verified in Electron (no desktop session in this environment) — covered by
connection-test-toast.test.ts.