feat: one-click release, global model alias pre-mapping, channel failover - #8
Merged
Conversation
workflow_dispatch now takes a required version input; a prepare job validates the version format and rejects existing tags, the three build jobs only upload artifacts, and a single publish job creates the tag + GitHub Release (auto-generated notes, prerelease when the version contains "-") and uploads all platform binaries. Tag-push triggered behavior is preserved. 🤖 Generated with Claude Code (Fable 5) Co-Authored-By: Claude <noreply@anthropic.com>
Global model alias (model_alias_setting.mapping): resolve aliases to the real model inside the distributor before token validation and channel selection, so routing, billing and log model names all use the real model. Supports chained mappings with cycle detection, rewrites the JSON body model field so pass-through requests never leak the alias upstream, and keeps the originally requested alias as a log annotation (requested_model_alias). Admin UI: System Settings -> Models -> Global Model Alias, reusing the visual model-mapping editor; saving validates against self-mapping and cycles. Channel failover (ChannelFailoverEnabled, default off, Operations -> Behavior): when a request fails with a retryable error, move it to another channel serving the same model in the same group. Failed channels are excluded on both the memory-cache and DB selection paths, the loop is independent of RetryTimes and terminates when candidates are exhausted, returning the last upstream error instead of "no channel available". Token-pinned channels and locked-channel task resumes never fail over; with the switch off every path behaves exactly as before. Tests: alias resolution/validation table tests and channel selection exclusion tests (priority-index compatibility, exclusion fallback, exhaustion, retry-index bypass, cache immutability). 🤖 Generated with Claude Code (Fable 5) Co-Authored-By: Claude <noreply@anthropic.com>
Mira PR Walkthrough🔍 Reviewing this PR… |
ItzPlana
added a commit
that referenced
this pull request
Aug 12, 2026
…pact suffix refs Merge origin/main into feat/error-message-override. Resolved conflicts in 5 files by keeping both feature additions (error override settings and the channel failover / model alias settings) side by side: - model/option.go (ErrorOverrideEnabled + ChannelFailoverEnabled cases) - system-behavior-section.tsx (both FormField blocks) - operations/index.tsx, section-registry.tsx, types.ts (both fields) While validating the merge, found that main's refactor bb234ff (QuantumNous#6770) removed ratio_setting.CompactModelSuffix / WithCompactModelSuffix but the failover/alias code merged in #8 still referenced them: - setting/model_setting/model_alias.go: ResolveModelAlias stripped and re-added the compact suffix around alias resolution. Now resolves the requested name verbatim, matching QuantumNous#6770's removal of compact-suffix special-casing. Updated the compact test case to assert verbatim aliasing of a compact-suffixed name instead. - middleware/distributor.go: dropped the strings.TrimSuffix(resolvedModel, ratio_setting.CompactModelSuffix) call so the rewritten request body model matches the resolved alias exactly. Also fixed two pre-existing build/vet breakages from the #8 merge that surfaced once compact-suffix references compiled: - controller/relay.go: shouldRetryTaskRelay gained a failoverEnabled bool parameter on the call site (line 637) but the definition was not updated; added the parameter to the signature and removed the stale reference to the unqualified failoverEnabled identifier. - model/channel_cache_failover_test.go: imported AdvancedCustomConfig from the root dto package, but it lives in relaykit/dto; switched the import alias accordingly. Verified: go build ./... + go vet ./... pass, relaykit builds standalone (GOWORK=off), and ./setting/operation_setting, ./service, ./model, ./setting/model_setting, relaykit/types tests all pass.
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.
📝 变更描述 / Description
release.yml支持 workflow_dispatch 输入版本号 → 自动建 tag、构建三平台产物、创建 GitHub Release(自动 notes、prerelease 判定)。保留 tag push 路径。注意:dispatch 发布不会连带触发 docker workflow,需手动。🚀 变更类型 / Type of change
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
go build ./...通过;go test(-vet=off)26 个包全部通过setting/model_setting/model_alias_test.go、model/channel_cache_failover_test.go全绿bun run typecheck通过,bun --bun run build构建成功,i18n 7 语言已同步🤖 Generated with Claude Code · Model: Fable 5 (claude-fable-5)