feat: add configurable reasoning effort to Coder agents (#26974)

This commit is contained in:
Danielle Maywood
2026-07-09 23:35:12 +01:00
committed by GitHub
parent 5fed583a46
commit d66e4d794f
72 changed files with 4389 additions and 1275 deletions
+99 -81
View File
@@ -107,6 +107,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -141,85 +142,86 @@ Experimental: this endpoint is subject to change.
Status Code **200**
| Name | Type | Required | Restrictions | Description |
|--------------------------|------------------------------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `[array item]` | array | false | | |
| `» agent_id` | string(uuid) | false | | |
| `» archived` | boolean | false | | |
| `» build_id` | string(uuid) | false | | |
| `» children` | [codersdk.Chat](schemas.md#codersdkchat) | false | | Children holds child (subagent) chats nested under this root chat. Always initialized to an empty slice so the JSON field is present as []. Child chats cannot create their own subagents, so nesting depth is capped at 1 and this slice is always empty for child chats. |
| `» client_type` | [codersdk.ChatClientType](schemas.md#codersdkchatclienttype) | false | | |
| `» context` | [codersdk.ChatContext](schemas.md#codersdkchatcontext) | false | | Context reports the chat's pinned workspace-context state and whether it has drifted from the agent's latest pushed snapshot. Nil when the chat has no pinned context yet. |
| `»» dirty` | boolean | false | | Dirty is true when the agent's latest snapshot hash differs from the chat's pinned hash. |
| `»» dirty_since` | string(date-time) | false | | Dirty since is when drift was first detected; nil when not dirty. |
| `»» error` | string | false | | Error is the snapshot-level error copied from the pinned snapshot (empty when healthy). |
| `»» resources` | array | false | | Resources is the chat's pinned context (instruction files and skills) the prompt is built from, metadata only (no bodies). It is populated only on the single-chat GET response; list and watch payloads leave it nil to stay lightweight. |
| `»»» error` | string | false | | Error explains a non-ok Status; empty when healthy. May also carry a non-fatal warning when Status is ok. |
| `»»» kind` | [codersdk.ChatContextResourceKind](schemas.md#codersdkchatcontextresourcekind) | false | | |
| `»»» size_bytes` | integer | false | | Size bytes is the original payload size in bytes. |
| `»»» skill_description` | string | false | | |
| `»»» skill_name` | string | false | | Skill name and SkillDescription are populated only for skill kinds. |
| `»»» source` | string | false | | Source is the resource locator: the canonical file path for an instruction file, the skill directory for a skill, the file path for an MCP config, or the server name for an MCP server. |
| `»»» status` | [codersdk.ChatContextResourceStatus](schemas.md#codersdkchatcontextresourcestatus) | false | | Status is the resource's health. Non-ok resources (invalid, unreadable, oversize, excluded) are still reported so the UI can surface why a resource was dropped from the prompt instead of silently omitting it; their body-specific fields (skill name, tools) are empty. |
| `»»» tools` | array | false | | Tools lists the tools exposed by an MCP server. Populated only for the mcp_server kind; nil otherwise. |
| `»»»» description` | string | false | | Description is the tool's human-readable summary; may be empty. |
| `»»»» name` | string | false | | Name is the tool name with the "<server>__" prefix the agent adds stripped, so it reads as the server exposes it. |
| `» created_at` | string(date-time) | false | | |
| `» diff_status` | [codersdk.ChatDiffStatus](schemas.md#codersdkchatdiffstatus) | false | | |
| `»» additions` | integer | false | | |
| `»» approved` | boolean | false | | |
| `»» author_avatar_url` | string | false | | |
| `»» author_login` | string | false | | |
| `»» base_branch` | string | false | | |
| `»» changed_files` | integer | false | | |
| `»» changes_requested` | boolean | false | | |
| `»» chat_id` | string(uuid) | false | | |
| `»» commits` | integer | false | | |
| `»» deletions` | integer | false | | |
| `»» head_branch` | string | false | | |
| `»» pr_number` | integer | false | | |
| `»» pull_request_draft` | boolean | false | | |
| `»» pull_request_state` | string | false | | |
| `»» pull_request_title` | string | false | | |
| `»» refreshed_at` | string(date-time) | false | | |
| `»» reviewer_count` | integer | false | | |
| `»» stale_at` | string(date-time) | false | | |
| `»» url` | string | false | | |
| `» files` | array | false | | |
| `»» created_at` | string(date-time) | false | | |
| `»» id` | string(uuid) | false | | |
| `»» mime_type` | string | false | | |
| `»» name` | string | false | | |
| `»» organization_id` | string(uuid) | false | | |
| `»» owner_id` | string(uuid) | false | | |
| `» has_unread` | boolean | false | | Has unread is true when assistant messages exist beyond the owner's read cursor, which updates on stream connect and disconnect. |
| `» id` | string(uuid) | false | | |
| `» labels` | object | false | | |
| `»» [any property]` | string | false | | |
| `» last_error` | [codersdk.ChatError](schemas.md#codersdkchaterror) | false | | |
| `»» detail` | string | false | | Detail is optional provider-specific context shown alongside the normalized error message when available. |
| `»» kind` | [codersdk.ChatErrorKind](schemas.md#codersdkchaterrorkind) | false | | Kind classifies the error for consistent client rendering. |
| `»» message` | string | false | | Message is the normalized, user-facing error message. |
| `»» provider` | string | false | | Provider identifies the upstream model provider when known. |
| `»» retryable` | boolean | false | | Retryable reports whether the underlying error is transient. |
| `»» status_code` | integer | false | | Status code is the best-effort upstream HTTP status code. |
| `» last_model_config_id` | string(uuid) | false | | |
| `» last_turn_summary` | string | false | | |
| `» mcp_server_ids` | array | false | | |
| `» organization_id` | string(uuid) | false | | |
| `» owner_id` | string(uuid) | false | | |
| `» owner_name` | string | false | | |
| `» owner_username` | string | false | | |
| `» parent_chat_id` | string(uuid) | false | | |
| `» pin_order` | integer | false | | |
| `» plan_mode` | [codersdk.ChatPlanMode](schemas.md#codersdkchatplanmode) | false | | |
| `» root_chat_id` | string(uuid) | false | | |
| `» shared` | boolean | false | | Shared is true when this chat's root chat has explicit user or group ACL entries. |
| `» status` | [codersdk.ChatStatus](schemas.md#codersdkchatstatus) | false | | |
| `» title` | string | false | | |
| `» updated_at` | string(date-time) | false | | |
| `» warnings` | array | false | | |
| `» workspace_id` | string(uuid) | false | | |
| Name | Type | Required | Restrictions | Description |
|---------------------------|------------------------------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `[array item]` | array | false | | |
| `» agent_id` | string(uuid) | false | | |
| `» archived` | boolean | false | | |
| `» build_id` | string(uuid) | false | | |
| `» children` | [codersdk.Chat](schemas.md#codersdkchat) | false | | Children holds child (subagent) chats nested under this root chat. Always initialized to an empty slice so the JSON field is present as []. Child chats cannot create their own subagents, so nesting depth is capped at 1 and this slice is always empty for child chats. |
| `» client_type` | [codersdk.ChatClientType](schemas.md#codersdkchatclienttype) | false | | |
| `» context` | [codersdk.ChatContext](schemas.md#codersdkchatcontext) | false | | Context reports the chat's pinned workspace-context state and whether it has drifted from the agent's latest pushed snapshot. Nil when the chat has no pinned context yet. |
| `»» dirty` | boolean | false | | Dirty is true when the agent's latest snapshot hash differs from the chat's pinned hash. |
| `»» dirty_since` | string(date-time) | false | | Dirty since is when drift was first detected; nil when not dirty. |
| `»» error` | string | false | | Error is the snapshot-level error copied from the pinned snapshot (empty when healthy). |
| `»» resources` | array | false | | Resources is the chat's pinned context (instruction files and skills) the prompt is built from, metadata only (no bodies). It is populated only on the single-chat GET response; list and watch payloads leave it nil to stay lightweight. |
| `»»» error` | string | false | | Error explains a non-ok Status; empty when healthy. May also carry a non-fatal warning when Status is ok. |
| `»»» kind` | [codersdk.ChatContextResourceKind](schemas.md#codersdkchatcontextresourcekind) | false | | |
| `»»» size_bytes` | integer | false | | Size bytes is the original payload size in bytes. |
| `»»» skill_description` | string | false | | |
| `»»» skill_name` | string | false | | Skill name and SkillDescription are populated only for skill kinds. |
| `»»» source` | string | false | | Source is the resource locator: the canonical file path for an instruction file, the skill directory for a skill, the file path for an MCP config, or the server name for an MCP server. |
| `»»» status` | [codersdk.ChatContextResourceStatus](schemas.md#codersdkchatcontextresourcestatus) | false | | Status is the resource's health. Non-ok resources (invalid, unreadable, oversize, excluded) are still reported so the UI can surface why a resource was dropped from the prompt instead of silently omitting it; their body-specific fields (skill name, tools) are empty. |
| `»»» tools` | array | false | | Tools lists the tools exposed by an MCP server. Populated only for the mcp_server kind; nil otherwise. |
| `»»»» description` | string | false | | Description is the tool's human-readable summary; may be empty. |
| `»»»» name` | string | false | | Name is the tool name with the "<server>__" prefix the agent adds stripped, so it reads as the server exposes it. |
| `» created_at` | string(date-time) | false | | |
| `» diff_status` | [codersdk.ChatDiffStatus](schemas.md#codersdkchatdiffstatus) | false | | |
| `»» additions` | integer | false | | |
| `»» approved` | boolean | false | | |
| `»» author_avatar_url` | string | false | | |
| `»» author_login` | string | false | | |
| `»» base_branch` | string | false | | |
| `»» changed_files` | integer | false | | |
| `»» changes_requested` | boolean | false | | |
| `»» chat_id` | string(uuid) | false | | |
| `»» commits` | integer | false | | |
| `»» deletions` | integer | false | | |
| `»» head_branch` | string | false | | |
| `»» pr_number` | integer | false | | |
| `»» pull_request_draft` | boolean | false | | |
| `»» pull_request_state` | string | false | | |
| `»» pull_request_title` | string | false | | |
| `»» refreshed_at` | string(date-time) | false | | |
| `»» reviewer_count` | integer | false | | |
| `»» stale_at` | string(date-time) | false | | |
| `»» url` | string | false | | |
| `» files` | array | false | | |
| `»» created_at` | string(date-time) | false | | |
| `»» id` | string(uuid) | false | | |
| `»» mime_type` | string | false | | |
| `»» name` | string | false | | |
| `»» organization_id` | string(uuid) | false | | |
| `»» owner_id` | string(uuid) | false | | |
| `» has_unread` | boolean | false | | Has unread is true when assistant messages exist beyond the owner's read cursor, which updates on stream connect and disconnect. |
| `» id` | string(uuid) | false | | |
| `» labels` | object | false | | |
| `»» [any property]` | string | false | | |
| `» last_error` | [codersdk.ChatError](schemas.md#codersdkchaterror) | false | | |
| `»» detail` | string | false | | Detail is optional provider-specific context shown alongside the normalized error message when available. |
| `»» kind` | [codersdk.ChatErrorKind](schemas.md#codersdkchaterrorkind) | false | | Kind classifies the error for consistent client rendering. |
| `»» message` | string | false | | Message is the normalized, user-facing error message. |
| `»» provider` | string | false | | Provider identifies the upstream model provider when known. |
| `»» retryable` | boolean | false | | Retryable reports whether the underlying error is transient. |
| `»» status_code` | integer | false | | Status code is the best-effort upstream HTTP status code. |
| `» last_model_config_id` | string(uuid) | false | | |
| `» last_reasoning_effort` | string | false | | |
| `» last_turn_summary` | string | false | | |
| `» mcp_server_ids` | array | false | | |
| `» organization_id` | string(uuid) | false | | |
| `» owner_id` | string(uuid) | false | | |
| `» owner_name` | string | false | | |
| `» owner_username` | string | false | | |
| `» parent_chat_id` | string(uuid) | false | | |
| `» pin_order` | integer | false | | |
| `» plan_mode` | [codersdk.ChatPlanMode](schemas.md#codersdkchatplanmode) | false | | |
| `» root_chat_id` | string(uuid) | false | | |
| `» shared` | boolean | false | | Shared is true when this chat's root chat has explicit user or group ACL entries. |
| `» status` | [codersdk.ChatStatus](schemas.md#codersdkchatstatus) | false | | |
| `» title` | string | false | | |
| `» updated_at` | string(date-time) | false | | |
| `» warnings` | array | false | | |
| `» workspace_id` | string(uuid) | false | | |
#### Enumerated Values
@@ -274,6 +276,7 @@ Experimental: this endpoint is subject to change.
"model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"plan_mode": "plan",
"reasoning_effort": "string",
"system_prompt": "string",
"unsafe_dynamic_tools": [
{
@@ -379,6 +382,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -471,6 +475,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -720,6 +725,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -866,6 +872,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -958,6 +965,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -1141,6 +1149,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -1233,6 +1242,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -1414,6 +1424,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -1506,6 +1517,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -1770,7 +1782,8 @@ Experimental: this endpoint is subject to change.
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205",
"plan_mode": "plan"
"plan_mode": "plan",
"reasoning_effort": "string"
}
```
@@ -1984,7 +1997,8 @@ Experimental: this endpoint is subject to change.
"type": "text"
}
],
"model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205"
"model_config_id": "f5fb4d91-62ca-4377-9ee6-5d43ba00d205",
"reasoning_effort": "string"
}
```
@@ -2254,6 +2268,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -2346,6 +2361,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -2852,6 +2868,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
@@ -2944,6 +2961,7 @@ Experimental: this endpoint is subject to change.
"status_code": 0
},
"last_model_config_id": "30ebb95f-c255-4759-9429-89aa4ec1554c",
"last_reasoning_effort": "string",
"last_turn_summary": "string",
"mcp_server_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"