Conversation
Classify connection tests by authentication, endpoint shape, wire support, model discovery, role, and reasoning instead of a single pass/fail. Missing /models with working inference is degraded-compatible, and responses vs chat/completions mismatches return structured reasons the renderer can show. Fixes OpenCoworkAI#213
Lxr-max
marked this pull request as ready for review
September 14, 2026 10:38
Replace polynomial unknown/unexpected-field regexes with substring checks so CodeQL no longer flags connection diagnostic matchers.
This was referenced Sep 14, 2026
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 could report “connected” while the endpoint was functionally incompatible (
/modelsmissing,responsesvschat/completionsmismatch,developerrole rejected, auth OK but the selected wire dead). This upgrades diagnostics from a single pass/fail string to layered capability classification so the renderer can show actionable reasons.Capability layers:
Overall status is
compatible,degraded-compatible(reachable and usable with a known limitation), orincompatible. Probe-only conclusions are taggedsource: "probe-only"so they are not treated as generate-time facts. This is additive on top of the existing provider auth/wire/baseUrl path and is meant to compose with the shared effective-provider contract from #216 rather than rewrite that stack.Type of change
Linked issue
Fixes #213
Related: #214, #216 (connection-test / generate parity is out of scope here)
Checklist
pnpmtests/typecheck pass for shared, providers, and desktop; repobiome checkon commitpnpm changeset) if user-visiblePrinciples 5b
ok,probeMethod,hint) remain;reasons/compatibilityare additiveWhat the renderer gets
runProviderTestnow returnsreasons: ConnectionCapabilityReason[]pluscompatibility. Settings Test connection shows a structured diagnostic panel (layer checklist + i18n causes). Missing/modelswith working inference is a warning (degraded-compatible), not a hard fail.responsesvschat/completionsincompatibility is an explicitwire-supportfailure withsuggestedWire.Tests
Cover auth vs endpoint vs wire vs model-discovery failures,
/models404 + live inference →degraded-compatible, responses/chat mismatch, developer-role degraded path, and renderer preference for IPC reasons over localerrorCodeinference.