feat: add OpenClaw User-Agent toggle, default off

Add a switch in the OpenClaw provider form to optionally send a browser
User-Agent header. The toggle defaults to off — only providers that
explicitly include headers in their preset or config will have it enabled.

Remove the previous auto-injection logic that force-added User-Agent on
every preset load and new provider creation.
This commit is contained in:
Jason
2026-03-09 10:36:11 +08:00
parent dd971246be
commit cc15d7b1e3
8 changed files with 67 additions and 0 deletions
+1
View File
@@ -522,6 +522,7 @@ export interface OpenClawProviderConfig {
apiKey?: string; // API 密钥
api?: string; // API 协议类型(如 "openai-completions"、"anthropic"
models?: OpenClawModel[]; // 可用模型列表
headers?: Record<string, string>; // 自定义请求头(如 User-Agent
}
// OpenClaw agents.defaults 完整配置