chore: deprecate /api/v2/aibridge/interceptions endpoint (#24670)

*Disclaimer: implemented by a Coder Agent using Claude Opus 4.6*

Marks the `GET /api/v2/aibridge/interceptions` endpoint as deprecated in
favor of `/aibridge/sessions`, which provides richer session-level
aggregation including threads and agentic actions.

Changes:
- Add `@Deprecated` Swagger annotation to the endpoint handler
- Add deprecation notice to the
`codersdk.Client.AIBridgeListInterceptions` method
- Regenerated OpenAPI spec with `"deprecated": true` flag

The endpoint remains fully functional.

Fixes https://github.com/coder/internal/issues/1339
This commit is contained in:
Danny Kopping
2026-04-23 15:33:40 +02:00
committed by GitHub
parent e17da2f648
commit a8613b2209
4 changed files with 10 additions and 1 deletions
+1
View File
@@ -122,6 +122,7 @@ const docTemplate = `{
],
"summary": "List AI Bridge interceptions",
"operationId": "list-ai-bridge-interceptions",
"deprecated": true,
"parameters": [
{
"type": "string",
+1
View File
@@ -95,6 +95,7 @@
"tags": ["AI Bridge"],
"summary": "List AI Bridge interceptions",
"operationId": "list-ai-bridge-interceptions",
"deprecated": true,
"parameters": [
{
"type": "string",
+3
View File
@@ -280,6 +280,9 @@ func (f AIBridgeListSessionsFilter) asRequestOption() RequestOption {
// AIBridgeListInterceptions returns AI Bridge interceptions with the given
// filter.
//
// Deprecated: Use AIBridgeListSessions instead, which provides richer
// session-level aggregation including threads and agentic actions.
func (c *Client) AIBridgeListInterceptions(ctx context.Context, filter AIBridgeListInterceptionsFilter) (AIBridgeListInterceptionsResponse, error) {
res, err := c.Request(ctx, http.MethodGet, "/api/v2/aibridge/interceptions", nil, filter.asRequestOption(), filter.Pagination.asRequestOption(), filter.Pagination.asRequestOption())
if err != nil {
+5 -1
View File
@@ -92,7 +92,10 @@ func aibridgeHandler(api *API, middlewares ...func(http.Handler) http.Handler) f
}
// aiBridgeListInterceptions returns all AI Bridge interceptions a user can read.
// Optional filters with query params
// Optional filters with query params.
//
// Deprecated: Use /aibridge/sessions instead, which provides richer
// session-level aggregation including threads and agentic actions.
//
// @Summary List AI Bridge interceptions
// @ID list-ai-bridge-interceptions
@@ -105,6 +108,7 @@ func aibridgeHandler(api *API, middlewares ...func(http.Handler) http.Handler) f
// @Param offset query int false "Offset pagination (cannot be used with after_id)"
// @Success 200 {object} codersdk.AIBridgeListInterceptionsResponse
// @Router /aibridge/interceptions [get]
// @Deprecated Use /aibridge/sessions instead.
func (api *API) aiBridgeListInterceptions(rw http.ResponseWriter, r *http.Request) {
ctx := r.Context()
apiKey := httpmw.APIKey(r)