feat: sync remaining channel and relay updates

This commit is contained in:
OpenClaw Task Bot
2026-04-27 08:56:38 +08:00
parent 0321101ff7
commit 58c0258362
18 changed files with 465 additions and 271 deletions

View File

@@ -178,6 +178,8 @@ func buildFetchModelsHeaders(channel *model.Channel, key string) (http.Header, e
switch channel.Type {
case constant.ChannelTypeAnthropic:
headers = GetClaudeAuthHeader(key)
case constant.ChannelTypeClaudeCodeCLIProxy:
headers = GetClaudeCodeAuthHeader(key)
default:
headers = GetAuthHeader(key)
}
@@ -469,6 +471,12 @@ func validateChannel(channel *model.Channel, isAdd bool) error {
}
}
if (channel.Type == constant.ChannelTypeCodexCLIProxy ||
channel.Type == constant.ChannelTypeClaudeCodeCLIProxy ||
channel.Type == constant.ChannelTypeGeminiCLIProxy) && strings.TrimSpace(channel.GetBaseURL()) == "" {
return fmt.Errorf("proxy-compatible channel requires base_url")
}
// Codex OAuth key validation (optional, only when JSON object is provided)
if channel.Type == constant.ChannelTypeCodex {
trimmedKey := strings.TrimSpace(channel.Key)