feat: byok observability api (#24207)

## Summary
Exposes `credential_kind` and `credential_hint` on AI Bridge session
threads, making credential metadata visible in the session detail API.
   
Each thread in the `/api/v2/aibridge/sessions/{session_id}` response now
includes:
- `credential_kind`: `centralized` or `byok`
- `credential_hint`: masked credential (e.g. `sk-a...pgAA`)
Values are taken from the thread's root interception.
## Changes

- `codersdk/aibridge.go`: Added `CredentialKind` and `CredentialHint`
fields to `AIBridgeThread`
- `coderd/database/db2sdk/db2sdk.go`: Populated from root interception
in `buildAIBridgeThread`
  - `SessionTimeline.stories.tsx`: Added fields to mock thread data
This commit is contained in:
Yevhenii Shcherbina
2026-04-09 11:41:17 -04:00
committed by GitHub
parent 65bf7c3b18
commit 8237822441
8 changed files with 30 additions and 0 deletions
+2
View File
@@ -334,6 +334,8 @@ curl -X GET http://coder-server:8080/api/v2/aibridge/sessions/{session_id} \
]
}
],
"credential_hint": "string",
"credential_kind": "string",
"ended_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"model": "string",
+6
View File
@@ -884,6 +884,8 @@
]
}
],
"credential_hint": "string",
"credential_kind": "string",
"ended_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"model": "string",
@@ -1019,6 +1021,8 @@
]
}
],
"credential_hint": "string",
"credential_kind": "string",
"ended_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"model": "string",
@@ -1043,6 +1047,8 @@
| Name | Type | Required | Restrictions | Description |
|-------------------|----------------------------------------------------------------------------------------|----------|--------------|-------------|
| `agentic_actions` | array of [codersdk.AIBridgeAgenticAction](#codersdkaibridgeagenticaction) | false | | |
| `credential_hint` | string | false | | |
| `credential_kind` | string | false | | |
| `ended_at` | string | false | | |
| `id` | string | false | | |
| `model` | string | false | | |