From 1057beb3270aba64068677f36adbc120667a3fd8 Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Tue, 13 Oct 2026 07:30:18 +0000 Subject: [PATCH] chore: hide internal reasoning provenance fields from API docs ProviderIdentity, ProviderModel, ProviderCredential, and ReasoningEpoch are stripped before API responses, so they no longer appear in the Swagger spec or the generated API reference. --- coderd/apidoc/docs.go | 16 ---------- coderd/apidoc/swagger.json | 16 ---------- codersdk/chats.go | 8 ++--- docs/reference/api/chats.md | 44 ------------------------- docs/reference/api/schemas.md | 60 ----------------------------------- 5 files changed, 4 insertions(+), 140 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 61ec8448f99..8d5a2bd8b9c 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -21311,18 +21311,10 @@ const docTemplate = `{ } } }, - "provider_credential": { - "description": "ProviderCredential records whether a reasoning part was produced\nwith the deployment's credential or the user's personal API key,\nbecause encrypted reasoning only decrypts for the organization\nbehind that credential. Internal only: stripped before API responses.", - "type": "string" - }, "provider_executed": { "description": "ProviderExecuted indicates the tool call was executed by\nthe provider (e.g. Anthropic computer use).", "type": "boolean" }, - "provider_identity": { - "description": "ProviderIdentity records the provider that produced a reasoning\npart, because a model config's provider can change after the\nmessage was written. Internal only: stripped before API responses.", - "type": "string" - }, "provider_metadata": { "description": "ProviderMetadata holds provider-specific response metadata\n(e.g. Anthropic cache control hints) as raw JSON. Internal\nonly: stripped by db2sdk before API responses.", "type": "array", @@ -21330,17 +21322,9 @@ const docTemplate = `{ "type": "integer" } }, - "provider_model": { - "description": "ProviderModel records the model that produced a reasoning part,\nbecause a model config's model can change after the message was\nwritten. Internal only: stripped before API responses.", - "type": "string" - }, "reasoning_delta": { "type": "string" }, - "reasoning_epoch": { - "description": "ReasoningEpoch records how many times the provider had rejected the\nchat's encrypted reasoning from this provider, model, and credential\nbefore this reasoning part was produced. A step that produced no\nreasoning after a rejection records its epoch, provider, model, and\ncredential on its first part instead. Internal only: stripped before\nAPI responses.", - "type": "integer" - }, "result": { "type": "array", "items": { diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index f3fbc19a18b..d927c0421a3 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -19241,18 +19241,10 @@ } } }, - "provider_credential": { - "description": "ProviderCredential records whether a reasoning part was produced\nwith the deployment's credential or the user's personal API key,\nbecause encrypted reasoning only decrypts for the organization\nbehind that credential. Internal only: stripped before API responses.", - "type": "string" - }, "provider_executed": { "description": "ProviderExecuted indicates the tool call was executed by\nthe provider (e.g. Anthropic computer use).", "type": "boolean" }, - "provider_identity": { - "description": "ProviderIdentity records the provider that produced a reasoning\npart, because a model config's provider can change after the\nmessage was written. Internal only: stripped before API responses.", - "type": "string" - }, "provider_metadata": { "description": "ProviderMetadata holds provider-specific response metadata\n(e.g. Anthropic cache control hints) as raw JSON. Internal\nonly: stripped by db2sdk before API responses.", "type": "array", @@ -19260,17 +19252,9 @@ "type": "integer" } }, - "provider_model": { - "description": "ProviderModel records the model that produced a reasoning part,\nbecause a model config's model can change after the message was\nwritten. Internal only: stripped before API responses.", - "type": "string" - }, "reasoning_delta": { "type": "string" }, - "reasoning_epoch": { - "description": "ReasoningEpoch records how many times the provider had rejected the\nchat's encrypted reasoning from this provider, model, and credential\nbefore this reasoning part was produced. A step that produced no\nreasoning after a rejection records its epoch, provider, model, and\ncredential on its first part instead. Internal only: stripped before\nAPI responses.", - "type": "integer" - }, "result": { "type": "array", "items": { diff --git a/codersdk/chats.go b/codersdk/chats.go index 1a35e33f8af..5fdae74b1dd 100644 --- a/codersdk/chats.go +++ b/codersdk/chats.go @@ -509,23 +509,23 @@ type ChatMessagePart struct { // ProviderIdentity records the provider that produced a reasoning // part, because a model config's provider can change after the // message was written. Internal only: stripped before API responses. - ProviderIdentity string `json:"provider_identity,omitempty" typescript:"-"` + ProviderIdentity string `json:"provider_identity,omitempty" typescript:"-" swaggerignore:"true"` // ProviderModel records the model that produced a reasoning part, // because a model config's model can change after the message was // written. Internal only: stripped before API responses. - ProviderModel string `json:"provider_model,omitempty" typescript:"-"` + ProviderModel string `json:"provider_model,omitempty" typescript:"-" swaggerignore:"true"` // ProviderCredential records whether a reasoning part was produced // with the deployment's credential or the user's personal API key, // because encrypted reasoning only decrypts for the organization // behind that credential. Internal only: stripped before API responses. - ProviderCredential string `json:"provider_credential,omitempty" typescript:"-"` + ProviderCredential string `json:"provider_credential,omitempty" typescript:"-" swaggerignore:"true"` // ReasoningEpoch records how many times the provider had rejected the // chat's encrypted reasoning from this provider, model, and credential // before this reasoning part was produced. A step that produced no // reasoning after a rejection records its epoch, provider, model, and // credential on its first part instead. Internal only: stripped before // API responses. - ReasoningEpoch int `json:"reasoning_epoch,omitempty" typescript:"-"` + ReasoningEpoch int `json:"reasoning_epoch,omitempty" typescript:"-" swaggerignore:"true"` // ProviderExecuted indicates the tool call was executed by // the provider (e.g. Anthropic computer use). ProviderExecuted bool `json:"provider_executed,omitempty" variants:"tool-call?,tool-result?"` diff --git a/docs/reference/api/chats.md b/docs/reference/api/chats.md index f3c3ead241c..2411e05f38e 100644 --- a/docs/reference/api/chats.md +++ b/docs/reference/api/chats.md @@ -2903,15 +2903,11 @@ curl -X GET http://coder-server:8080/api/v2/chats/{chat}/messages \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -2988,15 +2984,11 @@ curl -X GET http://coder-server:8080/api/v2/chats/{chat}/messages \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -3147,15 +3139,11 @@ curl -X POST http://coder-server:8080/api/v2/chats/{chat}/messages \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -3231,15 +3219,11 @@ curl -X POST http://coder-server:8080/api/v2/chats/{chat}/messages \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -3316,15 +3300,11 @@ curl -X POST http://coder-server:8080/api/v2/chats/{chat}/messages \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -3460,15 +3440,11 @@ curl -X PATCH http://coder-server:8080/api/v2/chats/{chat}/messages/{message} \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -3544,15 +3520,11 @@ curl -X PATCH http://coder-server:8080/api/v2/chats/{chat}/messages/{message} \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -4139,15 +4111,11 @@ curl -X GET http://coder-server:8080/api/v2/chats/{chat}/stream \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -4222,15 +4190,11 @@ curl -X GET http://coder-server:8080/api/v2/chats/{chat}/stream \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -4292,15 +4256,11 @@ curl -X GET http://coder-server:8080/api/v2/chats/{chat}/stream \ "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -4398,13 +4358,9 @@ Status Code **200** | `»»» media_type` | string | false | | | | `»»» name` | string | false | | | | `»»» parsed_commands` | array | false | | Parsed commands holds parsed programs from an execute tool call's shell command, one entry per simple command in source order. Each entry is [program] or [program, arg] where arg is the first non-flag positional argument. Program names are normalized to their base name (e.g. /usr/bin/go becomes go). Only populated when ToolName is "execute" and the command parses successfully; nil otherwise. | -| `»»» provider_credential` | string | false | | Provider credential records whether a reasoning part was produced with the deployment's credential or the user's personal API key, because encrypted reasoning only decrypts for the organization behind that credential. Internal only: stripped before API responses. | | `»»» provider_executed` | boolean | false | | Provider executed indicates the tool call was executed by the provider (e.g. Anthropic computer use). | -| `»»» provider_identity` | string | false | | Provider identity records the provider that produced a reasoning part, because a model config's provider can change after the message was written. Internal only: stripped before API responses. | | `»»» provider_metadata` | array | false | | Provider metadata holds provider-specific response metadata (e.g. Anthropic cache control hints) as raw JSON. Internal only: stripped by db2sdk before API responses. | -| `»»» provider_model` | string | false | | Provider model records the model that produced a reasoning part, because a model config's model can change after the message was written. Internal only: stripped before API responses. | | `»»» reasoning_delta` | string | false | | | -| `»»» reasoning_epoch` | integer | false | | Reasoning epoch records how many times the provider had rejected the chat's encrypted reasoning from this provider, model, and credential before this reasoning part was produced. A step that produced no reasoning after a rejection records its epoch, provider, model, and credential on its first part instead. Internal only: stripped before API responses. | | `»»» result` | array | false | | | | `»»» result_delta` | string | false | | | | `»»» result_reset` | boolean | false | | | diff --git a/docs/reference/api/schemas.md b/docs/reference/api/schemas.md index 59e69c89023..d3c98f10662 100644 --- a/docs/reference/api/schemas.md +++ b/docs/reference/api/schemas.md @@ -3238,15 +3238,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -3337,15 +3333,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -3397,13 +3389,9 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in | `media_type` | string | false | | | | `name` | string | false | | | | `parsed_commands` | array of array | false | | Parsed commands holds parsed programs from an execute tool call's shell command, one entry per simple command in source order. Each entry is [program] or [program, arg] where arg is the first non-flag positional argument. Program names are normalized to their base name (e.g. /usr/bin/go becomes go). Only populated when ToolName is "execute" and the command parses successfully; nil otherwise. | -| `provider_credential` | string | false | | Provider credential records whether a reasoning part was produced with the deployment's credential or the user's personal API key, because encrypted reasoning only decrypts for the organization behind that credential. Internal only: stripped before API responses. | | `provider_executed` | boolean | false | | Provider executed indicates the tool call was executed by the provider (e.g. Anthropic computer use). | -| `provider_identity` | string | false | | Provider identity records the provider that produced a reasoning part, because a model config's provider can change after the message was written. Internal only: stripped before API responses. | | `provider_metadata` | array of integer | false | | Provider metadata holds provider-specific response metadata (e.g. Anthropic cache control hints) as raw JSON. Internal only: stripped by db2sdk before API responses. | -| `provider_model` | string | false | | Provider model records the model that produced a reasoning part, because a model config's model can change after the message was written. Internal only: stripped before API responses. | | `reasoning_delta` | string | false | | | -| `reasoning_epoch` | integer | false | | Reasoning epoch records how many times the provider had rejected the chat's encrypted reasoning from this provider, model, and credential before this reasoning part was produced. A step that produced no reasoning after a rejection records its epoch, provider, model, and credential on its first part instead. Internal only: stripped before API responses. | | `result` | array of integer | false | | | | `result_delta` | string | false | | | | `result_reset` | boolean | false | | | @@ -3519,15 +3507,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -3604,15 +3588,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -4989,15 +4969,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -5156,15 +5132,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -5239,15 +5211,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -5309,15 +5277,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -5428,15 +5392,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -6290,15 +6250,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -6374,15 +6330,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -6459,15 +6411,11 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -9388,15 +9336,11 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ], @@ -9472,15 +9416,11 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o "string" ] ], - "provider_credential": "string", "provider_executed": true, - "provider_identity": "string", "provider_metadata": [ 0 ], - "provider_model": "string", "reasoning_delta": "string", - "reasoning_epoch": 0, "result": [ 0 ],