fix: lint issues from upstream merge
- gofmt: fix struct field alignment in AgentDefaults, WeComAIBotConfig - golines: break long lines in WeComAIBotConfig (move comments above fields) - unused: add nolint:unused to model_resolution.go funcs (wired in PR4) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7e74a3c328
commit
cec6423e0b
2 changed files with 44 additions and 34 deletions
|
|
@ -1,3 +1,6 @@
|
|||
// model_resolution.go provides model-list resolution helpers used by the upstream
|
||||
// loop refactor. These functions are currently unused but will be wired in PR4
|
||||
// (upstream-merge/core-loop).
|
||||
package agent
|
||||
|
||||
import (
|
||||
|
|
@ -8,6 +11,7 @@ import (
|
|||
"github.com/sipeed/picoclaw/pkg/providers"
|
||||
)
|
||||
|
||||
//nolint:unused // wired in PR4
|
||||
func buildModelListResolver(cfg *config.Config) func(raw string) (string, bool) {
|
||||
ensureProtocol := func(model string) string {
|
||||
model = strings.TrimSpace(model)
|
||||
|
|
@ -48,6 +52,7 @@ func buildModelListResolver(cfg *config.Config) func(raw string) (string, bool)
|
|||
}
|
||||
}
|
||||
|
||||
//nolint:unused // wired in PR4
|
||||
func resolveModelCandidates(
|
||||
cfg *config.Config,
|
||||
defaultProvider string,
|
||||
|
|
@ -64,6 +69,7 @@ func resolveModelCandidates(
|
|||
)
|
||||
}
|
||||
|
||||
//nolint:unused // wired in PR4
|
||||
func resolvedCandidateModel(candidates []providers.FallbackCandidate, fallback string) string {
|
||||
if len(candidates) > 0 && strings.TrimSpace(candidates[0].Model) != "" {
|
||||
return candidates[0].Model
|
||||
|
|
@ -71,6 +77,7 @@ func resolvedCandidateModel(candidates []providers.FallbackCandidate, fallback s
|
|||
return fallback
|
||||
}
|
||||
|
||||
//nolint:unused // wired in PR4
|
||||
func resolvedCandidateProvider(candidates []providers.FallbackCandidate, fallback string) string {
|
||||
if len(candidates) > 0 && strings.TrimSpace(candidates[0].Provider) != "" {
|
||||
return candidates[0].Provider
|
||||
|
|
@ -78,6 +85,7 @@ func resolvedCandidateProvider(candidates []providers.FallbackCandidate, fallbac
|
|||
return fallback
|
||||
}
|
||||
|
||||
//nolint:unused // wired in PR4
|
||||
func resolvedModelConfig(cfg *config.Config, modelName, workspace string) (*config.ModelConfig, error) {
|
||||
if cfg == nil {
|
||||
return nil, fmt.Errorf("config is nil")
|
||||
|
|
|
|||
|
|
@ -510,8 +510,10 @@ type WeComAIBotConfig struct {
|
|||
WebhookPath string `json:"webhook_path" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_WEBHOOK_PATH"`
|
||||
AllowFrom FlexibleStringSlice `json:"allow_from" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_ALLOW_FROM"`
|
||||
ReplyTimeout int `json:"reply_timeout" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_REPLY_TIMEOUT"`
|
||||
MaxSteps int `json:"max_steps" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_MAX_STEPS"` // Maximum streaming steps
|
||||
WelcomeMessage string `json:"welcome_message" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_WELCOME_MESSAGE"` // Sent on enter_chat event; empty = no welcome
|
||||
// MaxSteps is the maximum streaming steps.
|
||||
MaxSteps int `json:"max_steps" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_MAX_STEPS"`
|
||||
// WelcomeMessage is sent on enter_chat event; empty = no welcome.
|
||||
WelcomeMessage string `json:"welcome_message" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_WELCOME_MESSAGE"`
|
||||
ProcessingMessage string `json:"processing_message,omitempty" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_PROCESSING_MESSAGE"`
|
||||
ReasoningChannelID string `json:"reasoning_channel_id" env:"PICOCLAW_CHANNELS_WECOM_AIBOT_REASONING_CHANNEL_ID"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue