mirror of
https://github.com/coder/coder.git
synced 2026-09-22 13:10:21 +08:00
## Summary Plumbs the Responses output item id (added as `ToolUsageRecord.ItemID` in #26855) through to the database, captured independently of the `provider_tool_call_id` correlation key. Hosted tools (`web_search_call`, etc.) only have an item id; agentic tools have both. `provider_item_id` is specific to the OpenAI Responses API; it stays empty for chat completions and Anthropic messages, which have no separate item id. ## Changes - Migration `000534`: nullable `provider_item_id` column on `aibridge_tool_usages`. - Proto: `item_id` field 11 on `RecordToolUsageRequest`. - Server handler: persists `provider_item_id` and adds it to structured logging. - Translator: maps `ToolUsageRecord.ItemID` to the proto field. ## Tests - `TestRecordToolUsageProviderItemID`: real-database round-trip asserting `provider_item_id` persists for both hosted and agentic tools, independently of `provider_tool_call_id`. Stacked on #26855. Linear: AIGOV-96 --- _This PR was produced by opencode (agent) using the_ _`anthropic/claude-opus-4-8`_ _model, under human direction and review._