From 50a89667f4b70efce82c543b3cc7e53fdd02637c Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Wed, 19 Nov 2025 16:02:57 +0000 Subject: [PATCH 1/6] refactor: standardize "AIBridge" to "AI Bridge" across documentation, CLI, and API definitions. --- coderd/apidoc/docs.go | 4 ++-- coderd/apidoc/swagger.json | 4 ++-- docs/manifest.json | 6 +++--- docs/reference/api/aibridge.md | 4 ++-- docs/reference/cli/aibridge.md | 8 ++++---- docs/reference/cli/aibridge_interceptions.md | 8 ++++---- docs/reference/cli/aibridge_interceptions_list.md | 2 +- docs/reference/cli/index.md | 2 +- enterprise/cli/aibridge.go | 6 +++--- enterprise/cli/testdata/coder_--help.golden | 2 +- enterprise/cli/testdata/coder_aibridge_--help.golden | 4 ++-- .../testdata/coder_aibridge_interceptions_--help.golden | 4 ++-- .../coder_aibridge_interceptions_list_--help.golden | 2 +- enterprise/coderd/aibridge.go | 6 +++--- scripts/apidocgen/postprocess/main.go | 2 +- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index beacf64fc20b4..cbb448ba40738 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -96,9 +96,9 @@ const docTemplate = `{ "application/json" ], "tags": [ - "AIBridge" + "AI Bridge" ], - "summary": "List AIBridge interceptions", + "summary": "List AI Bridge interceptions", "operationId": "list-aibridge-interceptions", "parameters": [ { diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 477b01a8970aa..2a9c32e2cf350 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -73,8 +73,8 @@ } ], "produces": ["application/json"], - "tags": ["AIBridge"], - "summary": "List AIBridge interceptions", + "tags": ["AI Bridge"], + "summary": "List AI Bridge interceptions", "operationId": "list-aibridge-interceptions", "parameters": [ { diff --git a/docs/manifest.json b/docs/manifest.json index 8ef8e3e5fa326..e5af267cfc8ae 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1177,17 +1177,17 @@ "children": [ { "title": "aibridge", - "description": "Manage AIBridge.", + "description": "Manage AI Bridge.", "path": "reference/cli/aibridge.md" }, { "title": "aibridge interceptions", - "description": "Manage AIBridge interceptions.", + "description": "Manage AI Bridge interceptions.", "path": "reference/cli/aibridge_interceptions.md" }, { "title": "aibridge interceptions list", - "description": "List AIBridge interceptions as JSON.", + "description": "List AI Bridge interceptions as JSON.", "path": "reference/cli/aibridge_interceptions_list.md" }, { diff --git a/docs/reference/api/aibridge.md b/docs/reference/api/aibridge.md index 7e3a23fc5ec21..b7fbe0010850f 100644 --- a/docs/reference/api/aibridge.md +++ b/docs/reference/api/aibridge.md @@ -1,6 +1,6 @@ -# AIBridge +# AI Bridge -## List AIBridge interceptions +## List AI Bridge interceptions ### Code samples diff --git a/docs/reference/cli/aibridge.md b/docs/reference/cli/aibridge.md index 7b16c5cdc87a8..67e633682d433 100644 --- a/docs/reference/cli/aibridge.md +++ b/docs/reference/cli/aibridge.md @@ -1,7 +1,7 @@ # aibridge -Manage AIBridge. +Manage AI Bridge. ## Usage @@ -11,6 +11,6 @@ coder aibridge ## Subcommands -| Name | Purpose | -|-----------------------------------------------------------|--------------------------------| -| [interceptions](./aibridge_interceptions.md) | Manage AIBridge interceptions. | +| Name | Purpose | +|-----------------------------------------------------------|---------------------------------| +| [interceptions](./aibridge_interceptions.md) | Manage AI Bridge interceptions. | diff --git a/docs/reference/cli/aibridge_interceptions.md b/docs/reference/cli/aibridge_interceptions.md index 9cfb3d45a74ea..80c2135b07055 100644 --- a/docs/reference/cli/aibridge_interceptions.md +++ b/docs/reference/cli/aibridge_interceptions.md @@ -1,7 +1,7 @@ # aibridge interceptions -Manage AIBridge interceptions. +Manage AI Bridge interceptions. ## Usage @@ -11,6 +11,6 @@ coder aibridge interceptions ## Subcommands -| Name | Purpose | -|-------------------------------------------------------|--------------------------------------| -| [list](./aibridge_interceptions_list.md) | List AIBridge interceptions as JSON. | +| Name | Purpose | +|-------------------------------------------------------|---------------------------------------| +| [list](./aibridge_interceptions_list.md) | List AI Bridge interceptions as JSON. | diff --git a/docs/reference/cli/aibridge_interceptions_list.md b/docs/reference/cli/aibridge_interceptions_list.md index 7e86cd4968e33..a47b8c53dafd3 100644 --- a/docs/reference/cli/aibridge_interceptions_list.md +++ b/docs/reference/cli/aibridge_interceptions_list.md @@ -1,7 +1,7 @@ # aibridge interceptions list -List AIBridge interceptions as JSON. +List AI Bridge interceptions as JSON. ## Usage diff --git a/docs/reference/cli/index.md b/docs/reference/cli/index.md index 1005da991dc4f..958e475fea80c 100644 --- a/docs/reference/cli/index.md +++ b/docs/reference/cli/index.md @@ -68,7 +68,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr | [groups](./groups.md) | Manage groups | | [prebuilds](./prebuilds.md) | Manage Coder prebuilds | | [external-workspaces](./external-workspaces.md) | Create or manage external workspaces | -| [aibridge](./aibridge.md) | Manage AIBridge. | +| [aibridge](./aibridge.md) | Manage AI Bridge. | ## Options diff --git a/enterprise/cli/aibridge.go b/enterprise/cli/aibridge.go index 90953b6aa2bf2..a8e539713067a 100644 --- a/enterprise/cli/aibridge.go +++ b/enterprise/cli/aibridge.go @@ -17,7 +17,7 @@ const maxInterceptionsLimit = 1000 func (r *RootCmd) aibridge() *serpent.Command { cmd := &serpent.Command{ Use: "aibridge", - Short: "Manage AIBridge.", + Short: "Manage AI Bridge.", Handler: func(inv *serpent.Invocation) error { return inv.Command.HelpHandler(inv) }, @@ -31,7 +31,7 @@ func (r *RootCmd) aibridge() *serpent.Command { func (r *RootCmd) aibridgeInterceptions() *serpent.Command { cmd := &serpent.Command{ Use: "interceptions", - Short: "Manage AIBridge interceptions.", + Short: "Manage AI Bridge interceptions.", Handler: func(inv *serpent.Invocation) error { return inv.Command.HelpHandler(inv) }, @@ -55,7 +55,7 @@ func (r *RootCmd) aibridgeInterceptionsList() *serpent.Command { return &serpent.Command{ Use: "list", - Short: "List AIBridge interceptions as JSON.", + Short: "List AI Bridge interceptions as JSON.", Options: serpent.OptionSet{ { Flag: "initiator", diff --git a/enterprise/cli/testdata/coder_--help.golden b/enterprise/cli/testdata/coder_--help.golden index 51ee58258f8e4..78d27661f97c0 100644 --- a/enterprise/cli/testdata/coder_--help.golden +++ b/enterprise/cli/testdata/coder_--help.golden @@ -14,7 +14,7 @@ USAGE: $ coder templates init SUBCOMMANDS: - aibridge Manage AIBridge. + aibridge Manage AI Bridge. external-workspaces Create or manage external workspaces features List Enterprise features groups Manage groups diff --git a/enterprise/cli/testdata/coder_aibridge_--help.golden b/enterprise/cli/testdata/coder_aibridge_--help.golden index d005ae429ad50..5fdb98d21a479 100644 --- a/enterprise/cli/testdata/coder_aibridge_--help.golden +++ b/enterprise/cli/testdata/coder_aibridge_--help.golden @@ -3,10 +3,10 @@ coder v0.0.0-devel USAGE: coder aibridge - Manage AIBridge. + Manage AI Bridge. SUBCOMMANDS: - interceptions Manage AIBridge interceptions. + interceptions Manage AI Bridge interceptions. ——— Run `coder --help` for a list of global options. diff --git a/enterprise/cli/testdata/coder_aibridge_interceptions_--help.golden b/enterprise/cli/testdata/coder_aibridge_interceptions_--help.golden index 1f3b3af5ad3d3..49e36fb712177 100644 --- a/enterprise/cli/testdata/coder_aibridge_interceptions_--help.golden +++ b/enterprise/cli/testdata/coder_aibridge_interceptions_--help.golden @@ -3,10 +3,10 @@ coder v0.0.0-devel USAGE: coder aibridge interceptions - Manage AIBridge interceptions. + Manage AI Bridge interceptions. SUBCOMMANDS: - list List AIBridge interceptions as JSON. + list List AI Bridge interceptions as JSON. ——— Run `coder --help` for a list of global options. diff --git a/enterprise/cli/testdata/coder_aibridge_interceptions_list_--help.golden b/enterprise/cli/testdata/coder_aibridge_interceptions_list_--help.golden index c98fd0019a45a..307696c390486 100644 --- a/enterprise/cli/testdata/coder_aibridge_interceptions_list_--help.golden +++ b/enterprise/cli/testdata/coder_aibridge_interceptions_list_--help.golden @@ -3,7 +3,7 @@ coder v0.0.0-devel USAGE: coder aibridge interceptions list [flags] - List AIBridge interceptions as JSON. + List AI Bridge interceptions as JSON. OPTIONS: --after-id string diff --git a/enterprise/coderd/aibridge.go b/enterprise/coderd/aibridge.go index 3f3b1d6789a09..c1d96fbee2a85 100644 --- a/enterprise/coderd/aibridge.go +++ b/enterprise/coderd/aibridge.go @@ -57,14 +57,14 @@ func aibridgeHandler(api *API, middlewares ...func(http.Handler) http.Handler) f } } -// aiBridgeListInterceptions returns all AIBridge interceptions a user can read. +// aiBridgeListInterceptions returns all AI Bridge interceptions a user can read. // Optional filters with query params // -// @Summary List AIBridge interceptions +// @Summary List AI Bridge interceptions // @ID list-aibridge-interceptions // @Security CoderSessionToken // @Produce json -// @Tags AIBridge +// @Tags AI Bridge // @Param q query string false "Search query in the format `key:value`. Available keys are: initiator, provider, model, started_after, started_before." // @Param limit query int false "Page limit" // @Param after_id query string false "Cursor pagination after ID (cannot be used with offset)" diff --git a/scripts/apidocgen/postprocess/main.go b/scripts/apidocgen/postprocess/main.go index a37b85c975b3d..b09421efced35 100644 --- a/scripts/apidocgen/postprocess/main.go +++ b/scripts/apidocgen/postprocess/main.go @@ -239,5 +239,5 @@ func extractSectionName(section []byte) (string, error) { } func toMdFilename(sectionName string) string { - return nonAlphanumericRegex.ReplaceAllLiteralString(strings.ToLower(sectionName), "-") + ".md" + return nonAlphanumericRegex.ReplaceAllLiteralString(strings.ReplaceAll(strings.ToLower(sectionName), " ", ""), "-") + ".md" } From 89b7bbf72e82c70a2a0ddd8e6259344e50c67132 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Fri, 21 Nov 2025 19:28:52 +0000 Subject: [PATCH 2/6] Standardize AI Bridge operation IDs in API docs --- coderd/apidoc/docs.go | 2 +- coderd/apidoc/swagger.json | 2 +- enterprise/coderd/aibridge.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index f5e022723896c..f9c9aacfc1e68 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -99,7 +99,7 @@ const docTemplate = `{ "AI Bridge" ], "summary": "List AI Bridge interceptions", - "operationId": "list-aibridge-interceptions", + "operationId": "list-ai-bridge-interceptions", "parameters": [ { "type": "string", diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index abddcb41ab2ef..2a5debf72afd6 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -75,7 +75,7 @@ "produces": ["application/json"], "tags": ["AI Bridge"], "summary": "List AI Bridge interceptions", - "operationId": "list-aibridge-interceptions", + "operationId": "list-ai-bridge-interceptions", "parameters": [ { "type": "string", diff --git a/enterprise/coderd/aibridge.go b/enterprise/coderd/aibridge.go index c1d96fbee2a85..a41bb45857e36 100644 --- a/enterprise/coderd/aibridge.go +++ b/enterprise/coderd/aibridge.go @@ -61,7 +61,7 @@ func aibridgeHandler(api *API, middlewares ...func(http.Handler) http.Handler) f // Optional filters with query params // // @Summary List AI Bridge interceptions -// @ID list-aibridge-interceptions +// @ID list-ai-bridge-interceptions // @Security CoderSessionToken // @Produce json // @Tags AI Bridge From 109399c33d58be2b3328e71400d37ce19494ee35 Mon Sep 17 00:00:00 2001 From: M Atif Ali Date: Mon, 24 Nov 2025 16:54:55 +0500 Subject: [PATCH 3/6] Standardize "AI Bridge" terminology - Update references from "AIBridge" to "AI Bridge" across various files - Ensure consistent naming in documentation, code comments, and identifiers --- .github/workflows/typos.toml | 1 + cli/testdata/coder_server_--help.golden | 12 +++++----- coderd/database/dbauthz/dbauthz.go | 4 ++-- coderd/database/querier.go | 2 +- coderd/database/queries.sql.go | 2 +- coderd/database/queries/aibridge.sql | 2 +- coderd/rbac/regosql/configs.go | 2 +- coderd/telemetry/telemetry.go | 8 +++---- codersdk/aibridge.go | 4 ++-- codersdk/deployment.go | 24 +++++++++---------- .../cli/testdata/coder_server_--help.golden | 12 +++++----- enterprise/coderd/aibridge.go | 8 +++---- 12 files changed, 41 insertions(+), 40 deletions(-) diff --git a/.github/workflows/typos.toml b/.github/workflows/typos.toml index 8b3f77c1ef566..9008a998a9001 100644 --- a/.github/workflows/typos.toml +++ b/.github/workflows/typos.toml @@ -9,6 +9,7 @@ IST = "IST" MacOS = "macOS" AKS = "AKS" O_WRONLY = "O_WRONLY" +AIBridge = "AI Bridge" [default.extend-words] AKS = "AKS" diff --git a/cli/testdata/coder_server_--help.golden b/cli/testdata/coder_server_--help.golden index 49ce14b2f572f..751d232807c84 100644 --- a/cli/testdata/coder_server_--help.golden +++ b/cli/testdata/coder_server_--help.golden @@ -80,12 +80,7 @@ OPTIONS: Periodically check for new releases of Coder and inform the owner. The check is performed once per day. -AIBRIDGE OPTIONS: - --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) - Whether to inject Coder's MCP tools into intercepted AI Bridge - requests (requires the "oauth2" and "mcp-server-http" experiments to - be enabled). - +AI BRIDGE OPTIONS: --aibridge-anthropic-base-url string, $CODER_AIBRIDGE_ANTHROPIC_BASE_URL (default: https://api.anthropic.com/) The base URL of the Anthropic API. @@ -114,6 +109,11 @@ AIBRIDGE OPTIONS: --aibridge-enabled bool, $CODER_AIBRIDGE_ENABLED (default: false) Whether to start an in-memory aibridged instance. + --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) + Whether to inject Coder's MCP tools into intercepted AI Bridge + requests (requires the "oauth2" and "mcp-server-http" experiments to + be enabled). + --aibridge-openai-base-url string, $CODER_AIBRIDGE_OPENAI_BASE_URL (default: https://api.openai.com/v1/) The base URL of the OpenAI API. diff --git a/coderd/database/dbauthz/dbauthz.go b/coderd/database/dbauthz/dbauthz.go index 7cc074b5ce752..6ded10649d9b9 100644 --- a/coderd/database/dbauthz/dbauthz.go +++ b/coderd/database/dbauthz/dbauthz.go @@ -596,12 +596,12 @@ var ( // See aibridged package. subjectAibridged = rbac.Subject{ Type: rbac.SubjectAibridged, - FriendlyName: "AIBridge Daemon", + FriendlyName: "AI Bridge Daemon", ID: uuid.Nil.String(), Roles: rbac.Roles([]rbac.Role{ { Identifier: rbac.RoleIdentifier{Name: "aibridged"}, - DisplayName: "AIBridge Daemon", + DisplayName: "AI Bridge Daemon", Site: rbac.Permissions(map[string][]policy.Action{ rbac.ResourceUser.Type: { policy.ActionRead, // Required to validate API key owner is active. diff --git a/coderd/database/querier.go b/coderd/database/querier.go index 39fa7dab120bf..da988230d0ecd 100644 --- a/coderd/database/querier.go +++ b/coderd/database/querier.go @@ -610,7 +610,7 @@ type sqlcQuerier interface { InsertWorkspaceResource(ctx context.Context, arg InsertWorkspaceResourceParams) (WorkspaceResource, error) InsertWorkspaceResourceMetadata(ctx context.Context, arg InsertWorkspaceResourceMetadataParams) ([]WorkspaceResourceMetadatum, error) ListAIBridgeInterceptions(ctx context.Context, arg ListAIBridgeInterceptionsParams) ([]ListAIBridgeInterceptionsRow, error) - // Finds all unique AIBridge interception telemetry summaries combinations + // Finds all unique AI Bridge interception telemetry summaries combinations // (provider, model, client) in the given timeframe for telemetry reporting. ListAIBridgeInterceptionsTelemetrySummaries(ctx context.Context, arg ListAIBridgeInterceptionsTelemetrySummariesParams) ([]ListAIBridgeInterceptionsTelemetrySummariesRow, error) ListAIBridgeTokenUsagesByInterceptionIDs(ctx context.Context, interceptionIds []uuid.UUID) ([]AIBridgeTokenUsage, error) diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 557840db6794f..0e178a3c8e298 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -837,7 +837,7 @@ type ListAIBridgeInterceptionsTelemetrySummariesRow struct { Client string `db:"client" json:"client"` } -// Finds all unique AIBridge interception telemetry summaries combinations +// Finds all unique AI Bridge interception telemetry summaries combinations // (provider, model, client) in the given timeframe for telemetry reporting. func (q *sqlQuerier) ListAIBridgeInterceptionsTelemetrySummaries(ctx context.Context, arg ListAIBridgeInterceptionsTelemetrySummariesParams) ([]ListAIBridgeInterceptionsTelemetrySummariesRow, error) { rows, err := q.db.QueryContext(ctx, listAIBridgeInterceptionsTelemetrySummaries, arg.EndedAtAfter, arg.EndedAtBefore) diff --git a/coderd/database/queries/aibridge.sql b/coderd/database/queries/aibridge.sql index bd85e2be1e465..9f95f0243ec59 100644 --- a/coderd/database/queries/aibridge.sql +++ b/coderd/database/queries/aibridge.sql @@ -209,7 +209,7 @@ ORDER BY id ASC; -- name: ListAIBridgeInterceptionsTelemetrySummaries :many --- Finds all unique AIBridge interception telemetry summaries combinations +-- Finds all unique AI Bridge interception telemetry summaries combinations -- (provider, model, client) in the given timeframe for telemetry reporting. SELECT DISTINCT ON (provider, model, client) diff --git a/coderd/rbac/regosql/configs.go b/coderd/rbac/regosql/configs.go index b06d4d0583014..355a49756d587 100644 --- a/coderd/rbac/regosql/configs.go +++ b/coderd/rbac/regosql/configs.go @@ -81,7 +81,7 @@ func ConnectionLogConverter() *sqltypes.VariableConverter { func AIBridgeInterceptionConverter() *sqltypes.VariableConverter { matcher := sqltypes.NewVariableConverter().RegisterMatcher( resourceIDMatcher(), - // AIBridge interceptions are not tied to any organization. + // AI Bridge interceptions are not tied to any organization. sqltypes.StringVarMatcher("''", []string{"input", "object", "org_owner"}), sqltypes.StringVarMatcher("initiator_id :: text", []string{"input", "object", "owner"}), ) diff --git a/coderd/telemetry/telemetry.go b/coderd/telemetry/telemetry.go index 19873f99eeb2f..58822a93d7086 100644 --- a/coderd/telemetry/telemetry.go +++ b/coderd/telemetry/telemetry.go @@ -751,7 +751,7 @@ func (r *remoteReporter) createSnapshot() (*Snapshot, error) { eg.Go(func() error { summaries, err := r.generateAIBridgeInterceptionsSummaries(ctx) if err != nil { - return xerrors.Errorf("generate AIBridge interceptions telemetry summaries: %w", err) + return xerrors.Errorf("generate AI Bridge interceptions telemetry summaries: %w", err) } snapshot.AIBridgeInterceptionsSummaries = summaries return nil @@ -785,7 +785,7 @@ func (r *remoteReporter) generateAIBridgeInterceptionsSummaries(ctx context.Cont return nil, nil } if err != nil { - return nil, xerrors.Errorf("insert AIBridge interceptions telemetry lock (period_ending_at=%q): %w", endedAtBefore, err) + return nil, xerrors.Errorf("insert AI Bridge interceptions telemetry lock (period_ending_at=%q): %w", endedAtBefore, err) } // List the summary categories that need to be calculated. @@ -794,7 +794,7 @@ func (r *remoteReporter) generateAIBridgeInterceptionsSummaries(ctx context.Cont EndedAtBefore: endedAtBefore, // exclusive }) if err != nil { - return nil, xerrors.Errorf("list AIBridge interceptions telemetry summaries (startedAtAfter=%q, endedAtBefore=%q): %w", endedAtAfter, endedAtBefore, err) + return nil, xerrors.Errorf("list AI Bridge interceptions telemetry summaries (startedAtAfter=%q, endedAtBefore=%q): %w", endedAtAfter, endedAtBefore, err) } // Calculate and convert the summaries for all categories. @@ -813,7 +813,7 @@ func (r *remoteReporter) generateAIBridgeInterceptionsSummaries(ctx context.Cont EndedAtBefore: endedAtBefore, }) if err != nil { - return xerrors.Errorf("calculate AIBridge interceptions telemetry summary (provider=%q, model=%q, client=%q, startedAtAfter=%q, endedAtBefore=%q): %w", category.Provider, category.Model, category.Client, endedAtAfter, endedAtBefore, err) + return xerrors.Errorf("calculate AI Bridge interceptions telemetry summary (provider=%q, model=%q, client=%q, startedAtAfter=%q, endedAtBefore=%q): %w", category.Provider, category.Model, category.Client, endedAtAfter, endedAtBefore, err) } // Double check that at least one interception was found in the diff --git a/codersdk/aibridge.go b/codersdk/aibridge.go index a109a143b4f9c..09dab7caf04a9 100644 --- a/codersdk/aibridge.go +++ b/codersdk/aibridge.go @@ -65,7 +65,7 @@ type AIBridgeListInterceptionsResponse struct { // @typescript-ignore AIBridgeListInterceptionsFilter type AIBridgeListInterceptionsFilter struct { // Limit defaults to 100, max is 1000. - // Offset based pagination is not supported for AIBridge interceptions. Use + // Offset based pagination is not supported for AI Bridge interceptions. Use // cursor pagination instead with after_id. Pagination Pagination `json:"pagination,omitempty"` @@ -112,7 +112,7 @@ func (f AIBridgeListInterceptionsFilter) asRequestOption() RequestOption { } } -// AIBridgeListInterceptions returns AIBridge interceptions with the given +// AIBridgeListInterceptions returns AI Bridge interceptions with the given // filter. 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()) diff --git a/codersdk/deployment.go b/codersdk/deployment.go index 073ab7faede3e..e377e6276b221 100644 --- a/codersdk/deployment.go +++ b/codersdk/deployment.go @@ -1174,7 +1174,7 @@ func (c *DeploymentValues) Options() serpent.OptionSet { YAML: "inbox", } deploymentGroupAIBridge = serpent.Group{ - Name: "AIBridge", + Name: "AI Bridge", YAML: "aibridge", } ) @@ -3238,9 +3238,9 @@ Write out the current server config as YAML to stdout.`, YAML: "hideAITasks", }, - // AIBridge Options + // AI Bridge Options { - Name: "AIBridge Enabled", + Name: "AI Bridge Enabled", Description: "Whether to start an in-memory aibridged instance.", Flag: "aibridge-enabled", Env: "CODER_AIBRIDGE_ENABLED", @@ -3250,7 +3250,7 @@ Write out the current server config as YAML to stdout.`, YAML: "enabled", }, { - Name: "AIBridge OpenAI Base URL", + Name: "AI Bridge OpenAI Base URL", Description: "The base URL of the OpenAI API.", Flag: "aibridge-openai-base-url", Env: "CODER_AIBRIDGE_OPENAI_BASE_URL", @@ -3260,7 +3260,7 @@ Write out the current server config as YAML to stdout.`, YAML: "openai_base_url", }, { - Name: "AIBridge OpenAI Key", + Name: "AI Bridge OpenAI Key", Description: "The key to authenticate against the OpenAI API.", Flag: "aibridge-openai-key", Env: "CODER_AIBRIDGE_OPENAI_KEY", @@ -3270,7 +3270,7 @@ Write out the current server config as YAML to stdout.`, YAML: "openai_key", }, { - Name: "AIBridge Anthropic Base URL", + Name: "AI Bridge Anthropic Base URL", Description: "The base URL of the Anthropic API.", Flag: "aibridge-anthropic-base-url", Env: "CODER_AIBRIDGE_ANTHROPIC_BASE_URL", @@ -3280,7 +3280,7 @@ Write out the current server config as YAML to stdout.`, YAML: "anthropic_base_url", }, { - Name: "AIBridge Anthropic Key", + Name: "AI Bridge Anthropic Key", Description: "The key to authenticate against the Anthropic API.", Flag: "aibridge-anthropic-key", Env: "CODER_AIBRIDGE_ANTHROPIC_KEY", @@ -3290,7 +3290,7 @@ Write out the current server config as YAML to stdout.`, YAML: "anthropic_key", }, { - Name: "AIBridge Bedrock Region", + Name: "AI Bridge Bedrock Region", Description: "The AWS Bedrock API region.", Flag: "aibridge-bedrock-region", Env: "CODER_AIBRIDGE_BEDROCK_REGION", @@ -3300,7 +3300,7 @@ Write out the current server config as YAML to stdout.`, YAML: "bedrock_region", }, { - Name: "AIBridge Bedrock Access Key", + Name: "AI Bridge Bedrock Access Key", Description: "The access key to authenticate against the AWS Bedrock API.", Flag: "aibridge-bedrock-access-key", Env: "CODER_AIBRIDGE_BEDROCK_ACCESS_KEY", @@ -3310,7 +3310,7 @@ Write out the current server config as YAML to stdout.`, YAML: "bedrock_access_key", }, { - Name: "AIBridge Bedrock Access Key Secret", + Name: "AI Bridge Bedrock Access Key Secret", Description: "The access key secret to use with the access key to authenticate against the AWS Bedrock API.", Flag: "aibridge-bedrock-access-key-secret", Env: "CODER_AIBRIDGE_BEDROCK_ACCESS_KEY_SECRET", @@ -3320,7 +3320,7 @@ Write out the current server config as YAML to stdout.`, YAML: "bedrock_access_key_secret", }, { - Name: "AIBridge Bedrock Model", + Name: "AI Bridge Bedrock Model", Description: "The model to use when making requests to the AWS Bedrock API.", Flag: "aibridge-bedrock-model", Env: "CODER_AIBRIDGE_BEDROCK_MODEL", @@ -3330,7 +3330,7 @@ Write out the current server config as YAML to stdout.`, YAML: "bedrock_model", }, { - Name: "AIBridge Bedrock Small Fast Model", + Name: "AI Bridge Bedrock Small Fast Model", Description: "The small fast model to use when making requests to the AWS Bedrock API. Claude Code uses Haiku-class models to perform background tasks. See https://docs.claude.com/en/docs/claude-code/settings#environment-variables.", Flag: "aibridge-bedrock-small-fastmodel", Env: "CODER_AIBRIDGE_BEDROCK_SMALL_FAST_MODEL", diff --git a/enterprise/cli/testdata/coder_server_--help.golden b/enterprise/cli/testdata/coder_server_--help.golden index d272200609254..f4ff5339182d1 100644 --- a/enterprise/cli/testdata/coder_server_--help.golden +++ b/enterprise/cli/testdata/coder_server_--help.golden @@ -81,12 +81,7 @@ OPTIONS: Periodically check for new releases of Coder and inform the owner. The check is performed once per day. -AIBRIDGE OPTIONS: - --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) - Whether to inject Coder's MCP tools into intercepted AI Bridge - requests (requires the "oauth2" and "mcp-server-http" experiments to - be enabled). - +AI BRIDGE OPTIONS: --aibridge-anthropic-base-url string, $CODER_AIBRIDGE_ANTHROPIC_BASE_URL (default: https://api.anthropic.com/) The base URL of the Anthropic API. @@ -115,6 +110,11 @@ AIBRIDGE OPTIONS: --aibridge-enabled bool, $CODER_AIBRIDGE_ENABLED (default: false) Whether to start an in-memory aibridged instance. + --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) + Whether to inject Coder's MCP tools into intercepted AI Bridge + requests (requires the "oauth2" and "mcp-server-http" experiments to + be enabled). + --aibridge-openai-base-url string, $CODER_AIBRIDGE_OPENAI_BASE_URL (default: https://api.openai.com/v1/) The base URL of the OpenAI API. diff --git a/enterprise/coderd/aibridge.go b/enterprise/coderd/aibridge.go index a41bb45857e36..96bbe1d205181 100644 --- a/enterprise/coderd/aibridge.go +++ b/enterprise/coderd/aibridge.go @@ -144,7 +144,7 @@ func (api *API) aiBridgeListInterceptions(rw http.ResponseWriter, r *http.Reques }, nil) if err != nil { httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{ - Message: "Internal error getting AIBridge interceptions.", + Message: "Internal error getting AI Bridge interceptions.", Detail: err.Error(), }) return @@ -172,7 +172,7 @@ func populatedAndConvertAIBridgeInterceptions(ctx context.Context, db database.S ids[i] = row.AIBridgeInterception.ID } - //nolint:gocritic // This is a system function until we implement a join for aibridge interceptions. AIBridge interception subresources use the same authorization call as their parent. + //nolint:gocritic // This is a system function until we implement a join for aibridge interceptions. AI Bridge interception subresources use the same authorization call as their parent. tokenUsagesRows, err := db.ListAIBridgeTokenUsagesByInterceptionIDs(dbauthz.AsSystemRestricted(ctx), ids) if err != nil { return nil, xerrors.Errorf("get linked aibridge token usages from database: %w", err) @@ -182,7 +182,7 @@ func populatedAndConvertAIBridgeInterceptions(ctx context.Context, db database.S tokenUsagesMap[row.InterceptionID] = append(tokenUsagesMap[row.InterceptionID], row) } - //nolint:gocritic // This is a system function until we implement a join for aibridge interceptions. AIBridge interception subresources use the same authorization call as their parent. + //nolint:gocritic // This is a system function until we implement a join for aibridge interceptions. AI Bridge interception subresources use the same authorization call as their parent. userPromptRows, err := db.ListAIBridgeUserPromptsByInterceptionIDs(dbauthz.AsSystemRestricted(ctx), ids) if err != nil { return nil, xerrors.Errorf("get linked aibridge user prompts from database: %w", err) @@ -192,7 +192,7 @@ func populatedAndConvertAIBridgeInterceptions(ctx context.Context, db database.S userPromptsMap[row.InterceptionID] = append(userPromptsMap[row.InterceptionID], row) } - //nolint:gocritic // This is a system function until we implement a join for aibridge interceptions. AIBridge interception subresources use the same authorization call as their parent. + //nolint:gocritic // This is a system function until we implement a join for aibridge interceptions. AI Bridge interception subresources use the same authorization call as their parent. toolUsagesRows, err := db.ListAIBridgeToolUsagesByInterceptionIDs(dbauthz.AsSystemRestricted(ctx), ids) if err != nil { return nil, xerrors.Errorf("get linked aibridge tool usages from database: %w", err) From 9985cbc75b9a270c88795d6a46ec13904ac347c9 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Mon, 24 Nov 2025 12:25:13 +0000 Subject: [PATCH 4/6] fixup --- cli/testdata/coder_server_--help.golden | 18 +++++++++--------- .../cli/testdata/coder_server_--help.golden | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cli/testdata/coder_server_--help.golden b/cli/testdata/coder_server_--help.golden index 1444f8096148f..928bb609145ad 100644 --- a/cli/testdata/coder_server_--help.golden +++ b/cli/testdata/coder_server_--help.golden @@ -106,24 +106,24 @@ AI BRIDGE OPTIONS: See https://docs.claude.com/en/docs/claude-code/settings#environment-variables. - --aibridge-retention duration, $CODER_AIBRIDGE_RETENTION (default: 60d) - Length of time to retain data such as interceptions and all related - records (token, prompt, tool use). - --aibridge-enabled bool, $CODER_AIBRIDGE_ENABLED (default: false) Whether to start an in-memory aibridged instance. - --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) - Whether to inject Coder's MCP tools into intercepted AI Bridge - requests (requires the "oauth2" and "mcp-server-http" experiments to - be enabled). - --aibridge-openai-base-url string, $CODER_AIBRIDGE_OPENAI_BASE_URL (default: https://api.openai.com/v1/) The base URL of the OpenAI API. --aibridge-openai-key string, $CODER_AIBRIDGE_OPENAI_KEY The key to authenticate against the OpenAI API. + --aibridge-retention duration, $CODER_AIBRIDGE_RETENTION (default: 60d) + Length of time to retain data such as interceptions and all related + records (token, prompt, tool use). + + --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) + Whether to inject Coder's MCP tools into intercepted AIBridge requests + (requires the "oauth2" and "mcp-server-http" experiments to be + enabled). + CLIENT OPTIONS: These options change the behavior of how clients interact with the Coder. Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI. diff --git a/enterprise/cli/testdata/coder_server_--help.golden b/enterprise/cli/testdata/coder_server_--help.golden index 5ed217752b2c6..7caabf856743e 100644 --- a/enterprise/cli/testdata/coder_server_--help.golden +++ b/enterprise/cli/testdata/coder_server_--help.golden @@ -107,24 +107,24 @@ AI BRIDGE OPTIONS: See https://docs.claude.com/en/docs/claude-code/settings#environment-variables. - --aibridge-retention duration, $CODER_AIBRIDGE_RETENTION (default: 60d) - Length of time to retain data such as interceptions and all related - records (token, prompt, tool use). - --aibridge-enabled bool, $CODER_AIBRIDGE_ENABLED (default: false) Whether to start an in-memory aibridged instance. - --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) - Whether to inject Coder's MCP tools into intercepted AI Bridge - requests (requires the "oauth2" and "mcp-server-http" experiments to - be enabled). - --aibridge-openai-base-url string, $CODER_AIBRIDGE_OPENAI_BASE_URL (default: https://api.openai.com/v1/) The base URL of the OpenAI API. --aibridge-openai-key string, $CODER_AIBRIDGE_OPENAI_KEY The key to authenticate against the OpenAI API. + --aibridge-retention duration, $CODER_AIBRIDGE_RETENTION (default: 60d) + Length of time to retain data such as interceptions and all related + records (token, prompt, tool use). + + --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) + Whether to inject Coder's MCP tools into intercepted AIBridge requests + (requires the "oauth2" and "mcp-server-http" experiments to be + enabled). + CLIENT OPTIONS: These options change the behavior of how clients interact with the Coder. Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI. From 1a0d6190ae5557c860dd7ef211ac98dea84580de Mon Sep 17 00:00:00 2001 From: M Atif Ali Date: Mon, 24 Nov 2025 17:39:26 +0500 Subject: [PATCH 5/6] fixup! --- cli/testdata/coder_server_--help.golden | 2 +- cli/testdata/server-config.yaml.golden | 2 +- codersdk/deployment.go | 6 +++--- docs/reference/cli/server.md | 2 +- enterprise/cli/testdata/coder_server_--help.golden | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/testdata/coder_server_--help.golden b/cli/testdata/coder_server_--help.golden index 928bb609145ad..3df07f5b394b5 100644 --- a/cli/testdata/coder_server_--help.golden +++ b/cli/testdata/coder_server_--help.golden @@ -120,7 +120,7 @@ AI BRIDGE OPTIONS: records (token, prompt, tool use). --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) - Whether to inject Coder's MCP tools into intercepted AIBridge requests + Whether to inject Coder's MCP tools into intercepted AI Bridge requests (requires the "oauth2" and "mcp-server-http" experiments to be enabled). diff --git a/cli/testdata/server-config.yaml.golden b/cli/testdata/server-config.yaml.golden index d030e1d63c27b..8626eb60245fe 100644 --- a/cli/testdata/server-config.yaml.golden +++ b/cli/testdata/server-config.yaml.golden @@ -747,7 +747,7 @@ aibridge: # https://docs.claude.com/en/docs/claude-code/settings#environment-variables. # (default: global.anthropic.claude-haiku-4-5-20251001-v1:0, type: string) bedrock_small_fast_model: global.anthropic.claude-haiku-4-5-20251001-v1:0 - # Whether to inject Coder's MCP tools into intercepted AIBridge requests (requires + # Whether to inject Coder's MCP tools into intercepted AI Bridge requests (requires # the "oauth2" and "mcp-server-http" experiments to be enabled). # (default: false, type: bool) inject_coder_mcp_tools: false diff --git a/codersdk/deployment.go b/codersdk/deployment.go index d6dd74057979c..a51e3e9247e58 100644 --- a/codersdk/deployment.go +++ b/codersdk/deployment.go @@ -3340,8 +3340,8 @@ Write out the current server config as YAML to stdout.`, YAML: "bedrock_small_fast_model", }, { - Name: "AIBridge Inject Coder MCP tools", - Description: "Whether to inject Coder's MCP tools into intercepted AIBridge requests (requires the \"oauth2\" and \"mcp-server-http\" experiments to be enabled).", + Name: "AI Bridge Inject Coder MCP tools", + Description: "Whether to inject Coder's MCP tools into intercepted AI Bridge requests (requires the \"oauth2\" and \"mcp-server-http\" experiments to be enabled).", Flag: "aibridge-inject-coder-mcp-tools", Env: "CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS", Value: &c.AI.BridgeConfig.InjectCoderMCPTools, @@ -3350,7 +3350,7 @@ Write out the current server config as YAML to stdout.`, YAML: "inject_coder_mcp_tools", }, { - Name: "AIBridge Data Retention Duration", + Name: "AI Bridge Data Retention Duration", Description: "Length of time to retain data such as interceptions and all related records (token, prompt, tool use).", Flag: "aibridge-retention", Env: "CODER_AIBRIDGE_RETENTION", diff --git a/docs/reference/cli/server.md b/docs/reference/cli/server.md index 92c46ee8a9027..951e140f3f01f 100644 --- a/docs/reference/cli/server.md +++ b/docs/reference/cli/server.md @@ -1762,7 +1762,7 @@ The small fast model to use when making requests to the AWS Bedrock API. Claude | YAML | aibridge.inject_coder_mcp_tools | | Default | false | -Whether to inject Coder's MCP tools into intercepted AIBridge requests (requires the "oauth2" and "mcp-server-http" experiments to be enabled). +Whether to inject Coder's MCP tools into intercepted AI Bridge requests (requires the "oauth2" and "mcp-server-http" experiments to be enabled). ### --aibridge-retention diff --git a/enterprise/cli/testdata/coder_server_--help.golden b/enterprise/cli/testdata/coder_server_--help.golden index 7caabf856743e..887b6e3a37bf5 100644 --- a/enterprise/cli/testdata/coder_server_--help.golden +++ b/enterprise/cli/testdata/coder_server_--help.golden @@ -121,7 +121,7 @@ AI BRIDGE OPTIONS: records (token, prompt, tool use). --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) - Whether to inject Coder's MCP tools into intercepted AIBridge requests + Whether to inject Coder's MCP tools into intercepted AI Bridge requests (requires the "oauth2" and "mcp-server-http" experiments to be enabled). From 9c53c99acce801c43337f0de8199bc6e36a80073 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Mon, 24 Nov 2025 12:44:15 +0000 Subject: [PATCH 6/6] fixup --- cli/testdata/coder_server_--help.golden | 18 +++++++++--------- cli/testdata/server-config.yaml.golden | 4 ++-- .../cli/testdata/coder_server_--help.golden | 18 +++++++++--------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cli/testdata/coder_server_--help.golden b/cli/testdata/coder_server_--help.golden index 3df07f5b394b5..1444f8096148f 100644 --- a/cli/testdata/coder_server_--help.golden +++ b/cli/testdata/coder_server_--help.golden @@ -106,24 +106,24 @@ AI BRIDGE OPTIONS: See https://docs.claude.com/en/docs/claude-code/settings#environment-variables. + --aibridge-retention duration, $CODER_AIBRIDGE_RETENTION (default: 60d) + Length of time to retain data such as interceptions and all related + records (token, prompt, tool use). + --aibridge-enabled bool, $CODER_AIBRIDGE_ENABLED (default: false) Whether to start an in-memory aibridged instance. + --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) + Whether to inject Coder's MCP tools into intercepted AI Bridge + requests (requires the "oauth2" and "mcp-server-http" experiments to + be enabled). + --aibridge-openai-base-url string, $CODER_AIBRIDGE_OPENAI_BASE_URL (default: https://api.openai.com/v1/) The base URL of the OpenAI API. --aibridge-openai-key string, $CODER_AIBRIDGE_OPENAI_KEY The key to authenticate against the OpenAI API. - --aibridge-retention duration, $CODER_AIBRIDGE_RETENTION (default: 60d) - Length of time to retain data such as interceptions and all related - records (token, prompt, tool use). - - --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) - Whether to inject Coder's MCP tools into intercepted AI Bridge requests - (requires the "oauth2" and "mcp-server-http" experiments to be - enabled). - CLIENT OPTIONS: These options change the behavior of how clients interact with the Coder. Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI. diff --git a/cli/testdata/server-config.yaml.golden b/cli/testdata/server-config.yaml.golden index 8626eb60245fe..c8f1f94a85f23 100644 --- a/cli/testdata/server-config.yaml.golden +++ b/cli/testdata/server-config.yaml.golden @@ -747,8 +747,8 @@ aibridge: # https://docs.claude.com/en/docs/claude-code/settings#environment-variables. # (default: global.anthropic.claude-haiku-4-5-20251001-v1:0, type: string) bedrock_small_fast_model: global.anthropic.claude-haiku-4-5-20251001-v1:0 - # 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 AI Bridge requests + # (requires the "oauth2" and "mcp-server-http" experiments to be enabled). # (default: false, type: bool) inject_coder_mcp_tools: false # Length of time to retain data such as interceptions and all related records diff --git a/enterprise/cli/testdata/coder_server_--help.golden b/enterprise/cli/testdata/coder_server_--help.golden index 887b6e3a37bf5..5ed217752b2c6 100644 --- a/enterprise/cli/testdata/coder_server_--help.golden +++ b/enterprise/cli/testdata/coder_server_--help.golden @@ -107,24 +107,24 @@ AI BRIDGE OPTIONS: See https://docs.claude.com/en/docs/claude-code/settings#environment-variables. + --aibridge-retention duration, $CODER_AIBRIDGE_RETENTION (default: 60d) + Length of time to retain data such as interceptions and all related + records (token, prompt, tool use). + --aibridge-enabled bool, $CODER_AIBRIDGE_ENABLED (default: false) Whether to start an in-memory aibridged instance. + --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) + Whether to inject Coder's MCP tools into intercepted AI Bridge + requests (requires the "oauth2" and "mcp-server-http" experiments to + be enabled). + --aibridge-openai-base-url string, $CODER_AIBRIDGE_OPENAI_BASE_URL (default: https://api.openai.com/v1/) The base URL of the OpenAI API. --aibridge-openai-key string, $CODER_AIBRIDGE_OPENAI_KEY The key to authenticate against the OpenAI API. - --aibridge-retention duration, $CODER_AIBRIDGE_RETENTION (default: 60d) - Length of time to retain data such as interceptions and all related - records (token, prompt, tool use). - - --aibridge-inject-coder-mcp-tools bool, $CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS (default: false) - Whether to inject Coder's MCP tools into intercepted AI Bridge requests - (requires the "oauth2" and "mcp-server-http" experiments to be - enabled). - CLIENT OPTIONS: These options change the behavior of how clients interact with the Coder. Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI.