mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-18 09:37:28 +08:00
fix: tighten oauth and subagent messaging
This commit is contained in:
@@ -388,6 +388,46 @@ func TestResolveOAuthConfigAppliesProviderRefreshLeadDefaults(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveOAuthConfigUsesBuiltInGeminiClientDefaults(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
cfg, err := resolveOAuthConfig(config.ProviderConfig{
|
||||
Auth: "oauth",
|
||||
OAuth: config.ProviderOAuthConfig{
|
||||
Provider: "gemini",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("resolve oauth config failed: %v", err)
|
||||
}
|
||||
if cfg.ClientID != defaultGeminiClientIDValue {
|
||||
t.Fatalf("unexpected gemini client id: %q", cfg.ClientID)
|
||||
}
|
||||
if cfg.ClientSecret != defaultGeminiClientSecretValue {
|
||||
t.Fatalf("unexpected gemini client secret: %q", cfg.ClientSecret)
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveOAuthConfigUsesBuiltInAntigravityClientDefaults(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
cfg, err := resolveOAuthConfig(config.ProviderConfig{
|
||||
Auth: "oauth",
|
||||
OAuth: config.ProviderOAuthConfig{
|
||||
Provider: "antigravity",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("resolve oauth config failed: %v", err)
|
||||
}
|
||||
if cfg.ClientID != defaultAntigravityClientIDValue {
|
||||
t.Fatalf("unexpected antigravity client id: %q", cfg.ClientID)
|
||||
}
|
||||
if cfg.ClientSecret != defaultAntigravityClientSecretValue {
|
||||
t.Fatalf("unexpected antigravity client secret: %q", cfg.ClientSecret)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTTPProviderOAuthSessionProxyRoutesRefreshAndResponses(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user