From a8613b2209bd2a6264ee4aa577e774d74fa273b7 Mon Sep 17 00:00:00 2001 From: Danny Kopping Date: Thu, 23 Apr 2026 15:33:40 +0200 Subject: [PATCH] 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 --- coderd/apidoc/docs.go | 1 + coderd/apidoc/swagger.json | 1 + codersdk/aibridge.go | 3 +++ enterprise/coderd/aibridge.go | 6 +++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index f766a836a0..586d07a1db 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -122,6 +122,7 @@ const docTemplate = `{ ], "summary": "List AI Bridge interceptions", "operationId": "list-ai-bridge-interceptions", + "deprecated": true, "parameters": [ { "type": "string", diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 3f09eafba6..007ba4a302 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -95,6 +95,7 @@ "tags": ["AI Bridge"], "summary": "List AI Bridge interceptions", "operationId": "list-ai-bridge-interceptions", + "deprecated": true, "parameters": [ { "type": "string", diff --git a/codersdk/aibridge.go b/codersdk/aibridge.go index d9397cd979..2f00f8e80c 100644 --- a/codersdk/aibridge.go +++ b/codersdk/aibridge.go @@ -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 { diff --git a/enterprise/coderd/aibridge.go b/enterprise/coderd/aibridge.go index 3b44ce2bae..4560b2fac5 100644 --- a/enterprise/coderd/aibridge.go +++ b/enterprise/coderd/aibridge.go @@ -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)