Skip to content

Commit 4376678

Browse files
committed
feat: read teams_bridge_endpoint from status instead of deriving it
Add optional OUTPUT_ONLY teams_bridge_endpoint field to AIAgent. The bridge controller populates this when it starts serving, so console just displays it -- no URL gymnastics needed.
1 parent ef956a2 commit 4376678

6 files changed

Lines changed: 728 additions & 716 deletions

File tree

backend/pkg/protogen/redpanda/api/dataplane/v1alpha3/ai_agent.pb.go

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

frontend/src/components/pages/agents/details/ai-agent-integrations-tab.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,6 @@ const extractSecretName = (ref: string): string => {
5757
return match ? match[1] : '';
5858
};
5959

60-
// Agent URL format: https://<agent-id>.ai-agents.<cluster>.clusters.ign.rdpa.co
61-
const getMessagingEndpointUrl = (agentUrl: string, agentId: string): string => {
62-
try {
63-
const url = new URL(agentUrl);
64-
const hostParts = url.hostname.split('.');
65-
const aiAgentsIndex = hostParts.indexOf('ai-agents');
66-
if (aiAgentsIndex < 0 || aiAgentsIndex + 1 >= hostParts.length) {
67-
return '';
68-
}
69-
const clusterDomain = hostParts.slice(aiAgentsIndex + 1).join('.');
70-
return `https://msteams-bridge.${clusterDomain}/msteams/v1/${agentId}`;
71-
} catch {
72-
return '';
73-
}
74-
};
75-
7660
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Integrations tab with edit/view mode conditionals
7761
export const AIAgentIntegrationsTab = () => {
7862
const { id } = routeApi.useParams();
@@ -158,8 +142,6 @@ export const AIAgentIntegrationsTab = () => {
158142
setEditedState(null);
159143
};
160144

161-
const messagingEndpointUrl = agent.teamsBridge?.enabled && agent.url ? getMessagingEndpointUrl(agent.url, id) : '';
162-
163145
return (
164146
<div className="space-y-4">
165147
<Card className="px-0 py-0" size="full">
@@ -265,14 +247,14 @@ export const AIAgentIntegrationsTab = () => {
265247
)}
266248
</div>
267249

268-
{/* Messaging endpoint URL - shown when integration is saved and enabled */}
269-
{Boolean(agent.teamsBridge?.enabled && messagingEndpointUrl) && (
250+
{/* Messaging endpoint URL - populated by the bridge controller */}
251+
{Boolean(agent.teamsBridgeEndpoint) && (
270252
<div className="space-y-2">
271253
<Label>Messaging Endpoint</Label>
272254
<Text className="text-muted-foreground text-sm">
273255
Configure this URL as the messaging endpoint in your Azure Bot registration.
274256
</Text>
275-
<DynamicCodeBlock code={messagingEndpointUrl} lang="text" />
257+
<DynamicCodeBlock code={agent.teamsBridgeEndpoint ?? ''} lang="text" />
276258
</div>
277259
)}
278260
</CardContent>

frontend/src/protogen/redpanda/api/dataplane/v1alpha3/ai_agent_pb.ts

Lines changed: 8 additions & 1 deletion
Large diffs are not rendered by default.

proto/gen/openapi/openapi.v1alpha3.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

proto/gen/openapi/openapi.v1alpha3.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ components:
5454
type: object
5555
teams_bridge:
5656
$ref: '#/components/schemas/AIAgentTeamsBridge'
57+
teams_bridge_endpoint:
58+
description: Messaging endpoint URL for the Teams bridge, populated by the bridge controller.
59+
nullable: true
60+
readOnly: true
61+
type: string
5762
url:
5863
description: URL to connect to the AI agent endpoint.
5964
readOnly: true

proto/redpanda/api/dataplane/v1alpha3/ai_agent.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ message AIAgent {
111111
// Optional Microsoft Teams bridge configuration.
112112
AIAgentTeamsBridge teams_bridge = 18;
113113

114+
// Messaging endpoint URL for the Teams bridge, populated by the bridge controller.
115+
optional string teams_bridge_endpoint = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
116+
114117
message Provider {
115118
message OpenAI {
116119
string api_key = 1 [

0 commit comments

Comments
 (0)