feat: add configurable retention for aibridge (#20828)

Closes https://github.com/coder/internal/issues/1134

---------

Signed-off-by: Danny Kopping <danny@coder.com>
This commit is contained in:
Danny Kopping
2025-11-21 11:35:36 +02:00
committed by GitHub
parent 83966e346a
commit 5a7d4f69f6
20 changed files with 372 additions and 30 deletions
+2 -1
View File
@@ -179,7 +179,8 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"openai": {
"base_url": "string",
"key": "string"
}
},
"retention": 0
}
},
"allow_workspace_renames": true,
+9 -4
View File
@@ -393,7 +393,8 @@
"openai": {
"base_url": "string",
"key": "string"
}
},
"retention": 0
}
```
@@ -406,6 +407,7 @@
| `enabled` | boolean | false | | |
| `inject_coder_mcp_tools` | boolean | false | | |
| `openai` | [codersdk.AIBridgeOpenAIConfig](#codersdkaibridgeopenaiconfig) | false | | |
| `retention` | integer | false | | |
## codersdk.AIBridgeInterception
@@ -701,7 +703,8 @@
"openai": {
"base_url": "string",
"key": "string"
}
},
"retention": 0
}
}
```
@@ -2858,7 +2861,8 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"openai": {
"base_url": "string",
"key": "string"
}
},
"retention": 0
}
},
"allow_workspace_renames": true,
@@ -3373,7 +3377,8 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"openai": {
"base_url": "string",
"key": "string"
}
},
"retention": 0
}
},
"allow_workspace_renames": true,
+12 -1
View File
@@ -1762,4 +1762,15 @@ The small fast model to use when making requests to the AWS Bedrock API. Claude
| YAML | <code>aibridge.inject_coder_mcp_tools</code> |
| Default | <code>false</code> |
Whether to inject Coder's MCP tools into intercepted AI Bridge requests (requires the "oauth2" and "mcp-server-http" experiments to be enabled).
Whether to inject Coder's MCP tools into intercepted AIBridge requests (requires the "oauth2" and "mcp-server-http" experiments to be enabled).
### --aibridge-retention
| | |
|-------------|----------------------------------------|
| Type | <code>duration</code> |
| Environment | <code>$CODER_AIBRIDGE_RETENTION</code> |
| YAML | <code>aibridge.retention</code> |
| Default | <code>1440h</code> |
Length of time to retain data such as interceptions and all related records (token, prompt, tool use).