feat: add request/response dump support to aibridgeproxyd (#24837)

Closes https://github.com/coder/coder/issues/24335
This commit is contained in:
Marcin Tojek
2026-05-11 10:59:26 +02:00
committed by GitHub
parent fb60bb0c08
commit febabfb8b2
16 changed files with 277 additions and 24 deletions
+11
View File
@@ -3990,6 +3990,16 @@ Write out the current server config as YAML to stdout.`,
Group: &deploymentGroupAIBridgeProxy,
YAML: "allowed_private_cidrs",
},
{
Name: "AI Bridge Proxy API Dump Directory",
Description: "Directory for dumping MITM request/response pairs to disk for debugging. When set, each proxied request produces .req.txt and .resp.txt files organized by provider. Sensitive headers are redacted. Leave empty to disable.",
Flag: "aibridge-proxy-dump-dir",
Env: "CODER_AIBRIDGE_PROXY_DUMP_DIR",
Value: &c.AI.BridgeProxyConfig.APIDumpDir,
Default: "",
Group: &deploymentGroupAIBridgeProxy,
YAML: "api_dump_dir",
},
// Retention settings
{
@@ -4144,6 +4154,7 @@ type AIBridgeProxyConfig struct {
UpstreamProxy serpent.String `json:"upstream_proxy" typescript:",notnull"`
UpstreamProxyCA serpent.String `json:"upstream_proxy_ca" typescript:",notnull"`
AllowedPrivateCIDRs serpent.StringArray `json:"allowed_private_cidrs" typescript:",notnull"`
APIDumpDir serpent.String `json:"api_dump_dir" typescript:",notnull"`
}
type ChatConfig struct {