mateclaw/mateclaw-server/src/main/java/vip/mate
matevip ed37e81e7e feat(llm): multi-model failover chain driven by per-provider priority
Replaces the hardcoded single-DashScope fallback with a DB-driven
ordered chain. Same-provider primary deployments (e.g., DashScope
qwen-max) finally get a real fallback; if any provider in the chain
returns an empty body or transient failure, the next is tried.

Schema — DB-driven chain
- mate_model_provider gains `fallback_priority INT DEFAULT 0`. Positive
  values define try-order; 0 = not in chain. Migration V21 (h2 + mysql)
  seeds DashScope as priority 1 to preserve existing behavior.
- ModelProviderService.listFallbackChain() returns providers ordered by
  priority ascending.
- ModelProviderEntity gains the new field.

Runtime — chain walk + empty-response trigger
- AgentGraphBuilder.buildFallbackChain(primaryConfig) returns a
  List<ChatModel>, identity-filtering the primary by (providerId,
  modelName) — fixes the bug where same-provider-primary deployments got
  null fallback. Providers whose API key is missing are silently
  skipped with WARN. Old buildFallbackModel(ChatModel) kept as
  @Deprecated wrapper.
- NodeStreamingChatHelper accepts List<ChatModel>; the post-retry
  fallback block now walks the chain in priority order, single-shot
  per entry. Old single-fallback constructors retained as @Deprecated
  one-element-list wrappers so legacy callers keep working.
- New ErrorType.EMPTY_RESPONSE: when the LLM returns no content, no
  thinking, AND no tool calls, mark the result as a soft failure and
  break the same-model retry loop, handing off directly to the
  fallback chain.
- Broadcast updated to "切换到备选模型 (N/M)..." so SSE consumers see
  chain progress.

Tests
- NodeStreamingChatHelperFallbackChainTest covers constructor variants,
  chain immutability, deprecated-overload back-compat, and the
  EMPTY_RESPONSE enum exists as a compile-time contract.
- 159 tests pass (was 153 + 6 new).
2026-04-19 16:55:33 +08:00
..
agent feat(llm): multi-model failover chain driven by per-provider priority 2026-04-19 16:55:33 +08:00
approval refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
audit feat(platform): workspace isolation, info architecture, and UI redesign 2026-04-09 16:29:02 +08:00
auth refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
channel refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
common feat: 5 defensive hardenings 2026-04-15 22:14:55 +08:00
config refactor(ui): minimalist login redesign, MCP fixes, Flyway upgrade compatibility 2026-04-11 23:01:08 +08:00
cron refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
dashboard feat(wiki): real-time SSE progress + parallel page generation + partial-resume; fix concurrent slug collisions; fix skill overwrite + hub retry 2026-04-15 10:34:11 +08:00
datasource refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
exception fix(security): remove debug console.log and hide internal error details 2026-04-11 18:26:41 +08:00
hook chore(channel): remove stale external-reference comments; fix(wiki): canonical slug lookup on merge path 2026-04-15 16:44:02 +08:00
i18n refactor(prompt): clean up prompt corpus, fix summary_budget bug, route fallbacks through i18n 2026-04-19 09:02:37 +08:00
llm feat(llm): multi-model failover chain driven by per-provider priority 2026-04-19 16:55:33 +08:00
memory refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
planning refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
plugin refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
skill refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
stt feat: add TTS, STT, music generation, video providers (Runway/MiniMax), image providers (Google Imagen/MiniMax), and tool registry fix 2026-04-08 08:49:09 +08:00
system feat(ux): Phase 1 — onboarding, doctor, templates, navigation convergence 2026-04-09 00:32:35 +08:00
task feat(image,tts): add image generation with 4 providers and TTS with 3 providers 2026-04-07 22:14:31 +08:00
tool feat(agent): runtime efficiency — spill oversized tool results, add tool concurrency registry, collect cache metrics 2026-04-19 08:28:45 +08:00
tts fix(wiki): backend hardening + batch delete UI 2026-04-13 15:37:12 +08:00
wiki refactor(prompt): clean up prompt corpus, fix summary_budget bug, route fallbacks through i18n 2026-04-19 09:02:37 +08:00
workspace refactor(db): drop @TableLogic on all entities, purge soft-deleted rows 2026-04-18 23:31:48 +08:00
MateClawApplication.java Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00