qwen-code/docs
yao 0c5221ccaf
refactor(core): extract Protocol enum and decouple model identity from auth type (#5089)
* refactor(core): extract Protocol enum and decouple model identity from auth type

- AuthType: enum -> string (custom provider IDs supported)
- New Protocol enum: OPENAI, QWEN_OAUTH, GEMINI, ANTHROPIC
- ContentGeneratorConfig: add `protocol` field for SDK routing
- ProviderConfig: { protocol, models[], baseUrl?, envKey? }
- ModelProvidersConfig: Record<string, ProviderConfig>
- createContentGenerator: dispatch by `protocol` not `authType`
- v4->v5 migration: authType maps to protocol, models wrapped in ProviderConfig

* fix(test): packages/core/src/core/contentGenerator.test.ts

* fix(test): adapt tests to ProviderConfig modelProviders structure

* fix(test): adapt remaining test files to ProviderConfig and Protocol enum

* fix(test): add Protocol mock and update ProviderConfig assertion

* feat(config): add v4-to-v5 settings migration for modelProviders ProviderConfig format

* fix(vscode): write modelProviders in V5 ProviderConfig format

* fix(core): populate protocol on ContentGeneratorConfig from ModelRegistry

* fix(cli): handle ProviderConfig format in auth and ACP model lookup

* fix(providers): derive protocol from authType on first-time install

* test(core): add coverage for protocol dispatch in createContentGenerator

* fix(core): guard AUTH_ENV_MAPPINGS access with Object.hasOwn

* fix(cli): use bracket notation for ProviderConfig.models access in acpAgent

* chore(vscode): regenerate settings schema for v5

* fix(core): derive protocol from authType in resolveModelConfig fallback path

* fix: stale protocol on provider removal, ProviderConfig v4/v5 compat across all callers

* fix(cli): update modelProviders description in settingsSchema source and regenerate schema

* fix: resolve CI failures — InProcessBackend mock missing Protocol export

* fix(core,cli): address review feedback — protocol fallback, prototype safety, test coverage

- Add authTypeToProtocol fallback in ModelsConfig.getGenerationConfig for env-var users without
modelProviders
- Guard AUTH_TYPE_TO_PROTOCOL and PROVIDER_KEY_TO_PROTOCOL with Object.hasOwn to prevent prototype
chain pollution
- Use string literals in AUTH_TYPE_TO_PROTOCOL to break circular dependency with contentGenerator
- Add test coverage for getProtocolForAuthType, v4 array-format compat, and protocol assertions

* fix(core,cli): protocol lookup correctness and type safety

* fix(test): add getProtocol mock to subagent-manager test for ModelsConfig compat

* fix(test): add getProtocol mock to InProcessBackend test for ModelsConfig compat

* fix: resolve merge conflicts and adapt to v5 ProviderConfig format

  - Fix import statement format in server.ts
  - Update test files to use v5 ProviderConfig format (object instead of array)
  - Replace AuthType with Protocol enum in provider configs
  - Adapt modelConfigUtils.test.ts to v5 format

* fix: support custom authType in /model dialog

  - Add getAuthTypes() method to ModelRegistry
  - Update getAllConfiguredModels to use modelRegistry.getAuthTypes()
  - Fix ModelDialog to show custom authTypes alongside built-in ones

* fix(core,cli): address review feedback — Protocol type safety and v5 test format

  - Fix protocol field types from AuthType to Protocol in serve/types.ts
  - Fix protocol state type in useProviderSetupFlow.ts
  - Update getDefaultBaseUrlForProtocol parameter type to Protocol
  - Update install.test.ts to use v5 ProviderConfig format

* fix(cli): accept custom authType in parseAcpModelOption and authenticate

  - Remove z.nativeEnum(AuthType) validation since AuthType is now string
  - Support custom provider authType like 'qwen3.7-idealab' in /model command
  - Remove unused zod imports

* fix(test): adapt config.test.ts to v5 ProviderConfig format after merge

  Fix 3 v4 array format usages in config.test.ts that were introduced
  by merging main, converting them to v5 { protocol, models } format.

* fix(test): update acpModelUtils test and JSDoc to match new parser behavior

  - Update test: any non-empty token in trailing parens is now treated as authType
  - Add test: empty parens fallback returns whole input as modelId
  - Update JSDoc: remove "valid AuthType" since authType is now an arbitrary string

  No logic changes — test and docs only.
2026-06-22 23:35:02 +08:00
..
design refactor(cli): Finish serve kebab-case filenames (#5604) 2026-06-22 21:15:40 +08:00
developers refactor(cli): Finish serve kebab-case filenames (#5604) 2026-06-22 21:15:40 +08:00
e2e-tests feat(worktree): Phase D — startup --worktree flag + symlinkDirectories + PR refs (#4381) 2026-05-27 17:04:51 +08:00
plans feat(core)!: redesign auto-compaction thresholds with three-tier ladder (#4345) 2026-05-25 21:11:08 +08:00
superpowers feat(serve): add daemon idle detection to GET /health?deep=true (#4934) 2026-06-18 06:55:03 +00:00
users refactor(core): extract Protocol enum and decouple model identity from auth type (#5089) 2026-06-22 23:35:02 +08:00
verification/abort-controller-refactor fix(core): stop AbortSignal listener leak in long sessions (MaxListenersExceededWarning) (#4366) 2026-05-26 14:21:49 +08:00
_meta.ts feat: refactor docs 2025-12-05 10:51:57 +08:00
declarative-agents-port.md feat(core): port declarative-agent mcpServers + hooks (CC 2.1.168 parity follow-up) (#4996) 2026-06-12 14:15:51 +08:00
index.md fix: lint issues 2025-12-19 15:52:11 +08:00
yaml-parser-replacement.md feat(core): port declarative-agent mcpServers + hooks (CC 2.1.168 parity follow-up) (#4996) 2026-06-12 14:15:51 +08:00