diff --git a/clawgo_test b/clawgo_test new file mode 100755 index 0000000..de0e127 Binary files /dev/null and b/clawgo_test differ diff --git a/cmd/clawgo/main.go b/cmd/clawgo/main.go index e6f9f35..2cb6c8f 100644 --- a/cmd/clawgo/main.go +++ b/cmd/clawgo/main.go @@ -12,7 +12,6 @@ import ( "fmt" "io" "os" - "os/exec" "os/signal" "path/filepath" @@ -593,9 +592,9 @@ func gatewayCmd() { } var transcriber *voice.GroqTranscriber - if cfg.Providers.Groq.APIKey != "" { - transcriber = voice.NewGroqTranscriber(cfg.Providers.Groq.APIKey) - logger.InfoC("voice", "Groq voice transcription enabled") + if cfg.Providers.Proxy.APIKey != "" && strings.Contains(cfg.Providers.Proxy.APIBase, "groq.com") { + transcriber = voice.NewGroqTranscriber(cfg.Providers.Proxy.APIKey) + logger.InfoC("voice", "Groq voice transcription enabled via Proxy config") } if transcriber != nil { diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 789c2b9..0ab87ca 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -105,7 +105,7 @@ func NewAgentLoop(cfg *config.Config, msgBus *bus.MessageBus, provider providers // 注入递归运行逻辑,使 subagent 具备 full tool-calling 能力 subagentManager.SetRunFunc(func(ctx context.Context, task, channel, chatID string) (string, error) { - sessionKey := fmt.Sprintf("subagent:%d", time.Now().UnixNano()) + sessionKey := fmt.Sprintf("subagent:%d", os.Getpid()) // 改用 PID 或随机数,避免 sessionKey 冲突 return loop.ProcessDirect(ctx, task, sessionKey) })