fix(provider): enforce connection protocol contracts / 系统修复模型连接协议与错误恢复 - #9942
Merged
SivanCola merged 1 commit intoSep 8, 2026
Merged
Conversation
Problem: protocol changes could combine a provider-specific base path with the wrong request suffix, surface opaque internal IDs, and reload provider failures as generic interruptions. Root cause: provider identity, protocol routes, endpoint validation, and terminal display metadata were owned by separate layers without one shared contract. Fix: attach catalog identity to saved connections, resolve official protocol routes from the documented registry, validate mismatches in the editor, save path, and runtime, carry safe display diagnostics, and persist failed versus interrupted terminal status without changing provider-visible recovery bytes. Verification: root and Desktop Go suites, focused frontend tests, TypeScript and lint checks, production bundle budgets, compatibility guards, and git diff checks pass.
SivanCola
force-pushed
the
fix/provider-connection-contract
branch
from
September 8, 2026 07:22
0391f33 to
1453afb
Compare
This was referenced Sep 8, 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.
Problem
Changing a saved provider connection's API format could keep a provider-specific route prefix and append a different protocol suffix. A DeepSeek Anthropic route could therefore become
/anthropic/v1/chat/completions, return HTTP 404, expose the opaque internal provider ID, and later reload as a generic interrupted turn.Fix
ProviderViewrecords while keepingProviderEntry.Name, savedprovider/modelreferences, cache keys, and session references stable.failedversusinterruptedterminal display metadata so provider failures reload as their original HTTP/protocol error and user cancellation remains an interruption.Compatibility and cache behavior
deepseek-anthropicremains the stable connection ID.Impact declarations
Cache-impact: low - local recovery display metadata and typed error diagnostics change, while provider-visible request and recovery-summary bytes remain unchanged.
Cache-guard:
go test ./internal/agent -run TestInterruptedRecoveryDisplayMetadataDoesNotChangeProviderBlock -count=1verifies byte-identical provider-visible recovery content.System-prompt-review: SivanCola reviewed the
internal/bootendpoint-validation wiring; it does not change system-prompt content, ordering, or serialization.Documentation-impact: updated - the English and Chinese provider endpoint registries now document the DeepSeek Anthropic base alongside Chat and Responses routes.
Related PRs
request_urlderivation. This PR validates the effective endpoint contract before adapter construction and does not depend on that change.Validation
go test ./... -count=1 -p 1go test ./internal/config ./internal/provider/... ./internal/agent ./internal/boot ./internal/control -count=1 -p 1after rebasing onto218033719(cd desktop && go test . -count=1)(cd desktop/frontend && pnpm build)including TypeScript, lint, architecture, CSS, theme, and bundle-budget checksgit diff --check origin/main-v2...HEADThe default parallel root suite intermittently timed out
TestGoalTurnRunsPastTheOldRoundCeilingat its five-second wait boundary under local cross-package load. The same test passed 10/10 in isolation, the owning package passed normally, and the complete root suite passed with package concurrency disabled.