mateclaw/mateclaw-server/src/test/java/vip/mate/llm/chatmodel
倪程伟 bf224abc05
feat(llm): default model discovery by protocol for custom providers + configurable modelsPath
Custom (user-added) providers were hard-coded supportModelDiscovery=false in
createCustomProvider, so self-hosted OpenAI-compatible endpoints (vLLM /
Xinference / LocalAI / gateways) never surfaced the 'discover models' button —
users had to add every model id by hand.

- ModelProtocol: add per-protocol supportsSelfConfiguredDiscovery() + resolve()
  helper (single source of truth for chat-model class and capability flags).
  baseUrl+apiKey protocols (openai-compatible, dashscope-native, gemini-native,
  anthropic-messages) => true; OAuth protocols => false. The flag is deliberately
  narrower than 'can ever discover' (built-in ChatGPT-OAuth still discovers via
  its OAuth session); javadoc warns against reusing it to gate the button.
- createCustomProvider: default supportModelDiscovery from the resolved protocol
  instead of always false. Existing rows are unaffected (no migration).
- OpenAiModelsPath: new single source of truth for the models-listing path,
  honoring an optional 'modelsPath' generateKwargs override (mirrors the existing
  'completionsPath' override) for endpoints behind a reverse proxy / non-standard
  prefix (e.g. /openai/v1/models) that would otherwise 404 on /v1/models.
  Shared by BOTH discovery (ModelDiscoveryService) and the failover liveness
  probe (OpenAiCompatibleListModelsProbe) so an override can't make a provider
  discoverable yet still marked unhealthy by a probe hitting the wrong path.
- Tests: ModelProtocolTest (capability table + resolve fallback), OpenAiModelsPathTest
  (path branch table + vendor cases + modelsPath override), and custom-provider
  discovery-default assertions. Path-resolution coverage consolidated into
  OpenAiModelsPathTest (was split across the discovery + probe test files).
- Docs: zh/en models.md note custom-provider discovery + modelsPath override.

Refs matevip/mateclaw#519
2026-07-15 14:50:53 +08:00
..
AnthropicChatModelBuilderClaude47Test.java refactor(llm): decouple model construction from the agent graph layer (#147) 2026-05-18 07:47:49 +08:00
AnthropicChatModelBuilderClaude48Test.java feat(llm): add Claude Opus 4.8 + 4.8 Fast model entries 2026-05-29 07:06:19 +08:00
AnthropicChatModelBuilderFableTest.java feat(llm): add Claude Fable 5 support 2026-06-10 10:14:51 +08:00
AssistantThinkingRelayTest.java refactor(llm): decouple model construction from the agent graph layer (#147) 2026-05-18 07:47:49 +08:00
ClaudeCodeChatModelBuilderTest.java refactor(llm): decouple model construction from the agent graph layer (#147) 2026-05-18 07:47:49 +08:00
ClaudeCodeIdentityChatModelDecoratorTest.java chore: drop external project name references from code comments 2026-05-20 08:09:43 +08:00
DeepSeekV4ThinkingDecoratorTest.java refactor(llm): decouple model construction from the agent graph layer (#147) 2026-05-18 07:47:49 +08:00
HttpTimeoutsTest.java chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
OpenAiModelsPathTest.java feat(llm): default model discovery by protocol for custom providers + configurable modelsPath 2026-07-15 14:50:53 +08:00
PatchReasoningContentTest.java fix(goal): real evaluator, retry refactor, hardened node + extra edges 2026-05-21 22:27:00 +08:00
ReasoningContentCacheTest.java fix(goal): real evaluator, retry refactor, hardened node + extra edges 2026-05-21 22:27:00 +08:00
ReasoningEffortSanitizerTest.java refactor(llm): decouple model construction from the agent graph layer (#147) 2026-05-18 07:47:49 +08:00