mirror of
https://github.com/coder/coder.git
synced 2026-09-21 12:44:32 +08:00
fix: stop Agents dead-ending on unsupported providers (#26841)
Configuring only a GitHub Copilot provider left the Agents page stuck on "set up a provider then add a model", even with a provider and models configured. The catalog dropped any provider type that NormalizeProvider did not recognize, so a Copilot-only deployment looked identical to an empty one and never unlocked the page. The Agents harness cannot use Copilot: it needs a per-request token only an official Copilot client can mint, and the harness is not one. Instead of dropping such providers, the catalog now reports them as unsupported so the UI can explain the dead end and point elsewhere, rather than ask for setup that already happened. The providers stay usable through the AI Gateway proxy. Support is derived from the provider type, not stored, so there is no migration. codersdk.IsAgentsUnsupportedProviderType is the single source of truth, consulted by the chatd catalog and, through the generated AgentsUnsupportedProviderTypes list, the frontend. The diff also carries unrelated modernization of nearby db2sdk and chatprovider helpers (slices.SortFunc, strings.Cut, range-over-int). Closes CODAGT-627 Refs CODAGT-256 Refs CODAGT-682
This commit is contained in:
@@ -35,6 +35,12 @@ models, internal gateways, or third-party proxies like LiteLLM.
|
||||
Coder Agents route model requests through AI Gateway automatically by using
|
||||
the provider configuration stored in Coder's database.
|
||||
|
||||
Some provider types work as AI Gateway proxy targets but cannot back Coder
|
||||
Agents. GitHub Copilot, for example, authenticates with a per-request token
|
||||
that only an official Copilot client can mint, so the server-side Agents
|
||||
harness cannot use it. Configuring such a provider does not unlock Agents;
|
||||
add one of the supported provider types above instead.
|
||||
|
||||
### Add a provider
|
||||
|
||||
LLM providers are managed from the deployment AI settings, not from the Agents
|
||||
|
||||
Generated
+6
@@ -604,6 +604,12 @@ Experimental: this endpoint is subject to change.
|
||||
"provider": "string",
|
||||
"unavailable_reason": "missing_api_key"
|
||||
}
|
||||
],
|
||||
"unsupported_providers": [
|
||||
{
|
||||
"display_name": "string",
|
||||
"provider": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Generated
+26
-3
@@ -3190,15 +3190,22 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
"provider": "string",
|
||||
"unavailable_reason": "missing_api_key"
|
||||
}
|
||||
],
|
||||
"unsupported_providers": [
|
||||
{
|
||||
"display_name": "string",
|
||||
"provider": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|-------------|-------------------------------------------------------------------|----------|--------------|-------------|
|
||||
| `providers` | array of [codersdk.ChatModelProvider](#codersdkchatmodelprovider) | false | | |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|-------------------------|-------------------------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------------|
|
||||
| `providers` | array of [codersdk.ChatModelProvider](#codersdkchatmodelprovider) | false | | |
|
||||
| `unsupported_providers` | array of [codersdk.ChatUnsupportedProvider](#codersdkchatunsupportedprovider) | false | | Unsupported providers lists configured providers the Agents harness cannot use, so the UI can explain the empty state. |
|
||||
|
||||
## codersdk.ChatPlanMode
|
||||
|
||||
@@ -3824,6 +3831,22 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
| `tool_call_id` | string | false | | |
|
||||
| `tool_name` | string | false | | |
|
||||
|
||||
## codersdk.ChatUnsupportedProvider
|
||||
|
||||
```json
|
||||
{
|
||||
"display_name": "string",
|
||||
"provider": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|----------------|--------|----------|--------------|------------------------------------------------|
|
||||
| `display_name` | string | false | | |
|
||||
| `provider` | string | false | | Provider is the provider type, e.g. "copilot". |
|
||||
|
||||
## codersdk.ChatUser
|
||||
|
||||
```json
|
||||
|
||||
Reference in New Issue
Block a user