Skip to content

Commit ab4366f

Browse files
authored
feat!: implement AI Bridge heading to /deployment/observability (#20791)
> [!CAUTION] > In whichever release this lands, we've removed the ability to provide keys via a YAML file (specifically on `openai_key`, `anthropic_key`, `bedrock_access_key` and finally `bedrock_access_key_secret`). This will need to be described in the release notes as to not break peoples AI Bridge integrations upgrading from older versions. This pull-request ensures that we can see the overview of the settings of the `AI Bridge` feature within the `/deployment/observability` route. This set of options only render when the `aibridge` feature flag is enabled. ### Preview ![preview-ai-bridge-observability](https://github.com/user-attachments/assets/262d2456-94b4-49b2-9b4e-b14583e70ede)
1 parent afbe9ea commit ab4366f

File tree

7 files changed

+64
-22
lines changed

7 files changed

+64
-22
lines changed

cli/testdata/server-config.yaml.golden

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -720,25 +720,12 @@ aibridge:
720720
# The base URL of the OpenAI API.
721721
# (default: https://api.openai.com/v1/, type: string)
722722
openai_base_url: https://api.openai.com/v1/
723-
# The key to authenticate against the OpenAI API.
724-
# (default: <unset>, type: string)
725-
openai_key: ""
726723
# The base URL of the Anthropic API.
727724
# (default: https://api.anthropic.com/, type: string)
728725
anthropic_base_url: https://api.anthropic.com/
729-
# The key to authenticate against the Anthropic API.
730-
# (default: <unset>, type: string)
731-
anthropic_key: ""
732726
# The AWS Bedrock API region.
733727
# (default: <unset>, type: string)
734728
bedrock_region: ""
735-
# The access key to authenticate against the AWS Bedrock API.
736-
# (default: <unset>, type: string)
737-
bedrock_access_key: ""
738-
# The access key secret to use with the access key to authenticate against the AWS
739-
# Bedrock API.
740-
# (default: <unset>, type: string)
741-
bedrock_access_key_secret: ""
742729
# The model to use when making requests to the AWS Bedrock API.
743730
# (default: global.anthropic.claude-sonnet-4-5-20250929-v1:0, type: string)
744731
bedrock_model: global.anthropic.claude-sonnet-4-5-20250929-v1:0

codersdk/deployment.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,7 +3270,7 @@ Write out the current server config as YAML to stdout.`,
32703270
Value: &c.AI.BridgeConfig.OpenAI.Key,
32713271
Default: "",
32723272
Group: &deploymentGroupAIBridge,
3273-
YAML: "openai_key",
3273+
Annotations: serpent.Annotations{}.Mark(annotationSecretKey, "true"),
32743274
},
32753275
{
32763276
Name: "AI Bridge Anthropic Base URL",
@@ -3290,7 +3290,7 @@ Write out the current server config as YAML to stdout.`,
32903290
Value: &c.AI.BridgeConfig.Anthropic.Key,
32913291
Default: "",
32923292
Group: &deploymentGroupAIBridge,
3293-
YAML: "anthropic_key",
3293+
Annotations: serpent.Annotations{}.Mark(annotationSecretKey, "true"),
32943294
},
32953295
{
32963296
Name: "AI Bridge Bedrock Region",
@@ -3310,7 +3310,7 @@ Write out the current server config as YAML to stdout.`,
33103310
Value: &c.AI.BridgeConfig.Bedrock.AccessKey,
33113311
Default: "",
33123312
Group: &deploymentGroupAIBridge,
3313-
YAML: "bedrock_access_key",
3313+
Annotations: serpent.Annotations{}.Mark(annotationSecretKey, "true"),
33143314
},
33153315
{
33163316
Name: "AI Bridge Bedrock Access Key Secret",
@@ -3320,7 +3320,7 @@ Write out the current server config as YAML to stdout.`,
33203320
Value: &c.AI.BridgeConfig.Bedrock.AccessKeySecret,
33213321
Default: "",
33223322
Group: &deploymentGroupAIBridge,
3323-
YAML: "bedrock_access_key_secret",
3323+
Annotations: serpent.Annotations{}.Mark(annotationSecretKey, "true"),
33243324
},
33253325
{
33263326
Name: "AI Bridge Bedrock Model",

codersdk/deployment_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,20 @@ func TestDeploymentValues_HighlyConfigurable(t *testing.T) {
8484
"Notifications: Email Auth: Password": {
8585
yaml: true,
8686
},
87+
// We don't want these to be configurable via YAML because they are secrets.
88+
// However, we do want to allow them to be shown in documentation.
89+
"AI Bridge OpenAI Key": {
90+
yaml: true,
91+
},
92+
"AI Bridge Anthropic Key": {
93+
yaml: true,
94+
},
95+
"AI Bridge Bedrock Access Key": {
96+
yaml: true,
97+
},
98+
"AI Bridge Bedrock Access Key Secret": {
99+
yaml: true,
100+
},
87101
}
88102

89103
set := (&codersdk.DeploymentValues{}).Options()

docs/reference/cli/server.md

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/pages/DeploymentSettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const ObservabilitySettingsPage: FC = () => {
1717
<ObservabilitySettingsPageView
1818
options={deploymentConfig.options}
1919
featureAuditLogEnabled={entitlements.features.audit_log.enabled}
20+
featureAIBridgeEnabled={entitlements.features.aibridge.enabled}
2021
isPremium={hasPremiumLicense}
2122
/>
2223
</>

site/src/pages/DeploymentSettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPageView.stories.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,18 @@ type Story = StoryObj<typeof ObservabilitySettingsPageView>;
5454
export const Page: Story = {};
5555

5656
export const Premium: Story = { args: { isPremium: true } };
57+
58+
export const AI_Bridge: Story = {
59+
args: {
60+
featureAIBridgeEnabled: true,
61+
options: [
62+
{
63+
name: "AI Bridge Enabled",
64+
value: true,
65+
group: { name: "AI Bridge" },
66+
flag: "aibridge-enabled",
67+
hidden: false,
68+
},
69+
],
70+
},
71+
};

site/src/pages/DeploymentSettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPageView.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@ import OptionsTable from "../OptionsTable";
2525
type ObservabilitySettingsPageViewProps = {
2626
options: SerpentOption[];
2727
featureAuditLogEnabled: boolean;
28+
featureAIBridgeEnabled: boolean;
2829
isPremium: boolean;
2930
};
3031

3132
export const ObservabilitySettingsPageView: FC<
3233
ObservabilitySettingsPageViewProps
33-
> = ({ options, featureAuditLogEnabled, isPremium }) => {
34+
> = ({
35+
options,
36+
featureAuditLogEnabled,
37+
isPremium,
38+
featureAIBridgeEnabled,
39+
}) => {
3440
return (
3541
<Stack direction="column" spacing={6}>
3642
<div>
@@ -94,6 +100,29 @@ export const ObservabilitySettingsPageView: FC<
94100
)}
95101
/>
96102
</div>
103+
104+
{featureAIBridgeEnabled && (
105+
<div>
106+
<SettingsHeader
107+
actions={
108+
<SettingsHeaderDocsLink href={docs("/ai-coder/ai-bridge")} />
109+
}
110+
>
111+
<SettingsHeaderTitle hierarchy="secondary" level="h2">
112+
AI Bridge
113+
</SettingsHeaderTitle>
114+
<SettingsHeaderDescription>
115+
Monitor and manage AI requests across your deployment.
116+
</SettingsHeaderDescription>
117+
</SettingsHeader>
118+
119+
<OptionsTable
120+
options={options
121+
.filter((o) => deploymentGroupHasParent(o.group, "AI Bridge"))
122+
.filter((o) => !o.annotations?.secret === true)}
123+
/>
124+
</div>
125+
)}
97126
</Stack>
98127
);
99128
};

0 commit comments

Comments
 (0)