Repository navigation
Conversation
Docs preview📖 View docs preview for |
3b373fa to
421a5e9
Compare
ed6ecfb to
8d8b388
Compare
|
/coder-agents-review |
|
Chat: Review posted | View chat Review historydeep-review v0.9.0 | Round 2 | Last posted: Round 2, 5 findings (2 P3, 3 Nit), COMMENT. Review Finding inventoryFindings
Round logRound 1Panel. 2 P3, 2 Nit, 1 P4, 2 Note. 3 dropped. Reviewed against ce94d42..8d8b38836942. Round 2Panel. CRF-1/3/4 fixed, CRF-2 panel-closed. 1 new Nit. Reviewed against ce94d42..a0eb56250fe7. Contested and acknowledgedCRF-2 (P3, db2sdk.go:578) - Drive-by modernization
About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
8d8b388 to
4b0e18b
Compare
DanielleMaywood
left a comment
There was a problem hiding this comment.
Just a quick comment but this PR has random unrelated code changes in it. Intended?
There was a problem hiding this comment.
Pull request overview
Prevents the Agents UI from dead-ending when the only configured AI providers are unservable by the Agents harness (notably GitHub Copilot) by explicitly surfacing “unsupported providers” in the model catalog and updating the UI to explain the situation.
Changes:
- Adds
agents_supported/agents_unsupported_reasonto AI provider API responses and labels unsupported providers in AI Settings. - Extends the chat model catalog response with
unsupported_providersand uses it to drive an improved Agents empty state and omit unsupported providers from the picker. - Updates Storybook stories and unit tests across site + Go to cover the new “unsupported provider” behavior.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| site/src/testHelpers/entities.ts | Updates AI provider mocks with agents_supported and Copilot unsupported reason. |
| site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.tsx | Shows “Not supported in Agents” badge for providers the harness cannot serve. |
| site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.stories.tsx | Adds stories and interaction checks for the unsupported badge behavior. |
| site/src/pages/AgentsPage/utils/modelOptions.ts | Adds helper to derive unsupported provider names from the catalog. |
| site/src/pages/AgentsPage/utils/modelOptions.test.ts | Tests getUnsupportedProviderNames behavior across supported/unsupported combinations. |
| site/src/pages/AgentsPage/components/ChatPageContent.tsx | Threads unsupportedProviderNames down into the Agents chat input. |
| site/src/pages/AgentsPage/components/AgentSetupNotice.tsx | Adds an empty-state branch that explains “configured but not supported by Agents”. |
| site/src/pages/AgentsPage/components/AgentSetupNotice.stories.tsx | Adds stories validating the new empty-state messaging for admin and members. |
| site/src/pages/AgentsPage/components/AgentCreateForm.tsx | Passes unsupportedProviderNames to setup notice rendering in create flow. |
| site/src/pages/AgentsPage/components/AgentCreateForm.stories.tsx | Updates model catalog fixtures to include unsupported_providers. |
| site/src/pages/AgentsPage/components/AgentChatInput.tsx | Passes unsupportedProviderNames into setup notice rendering in chat input. |
| site/src/pages/AgentsPage/AgentsPageView.stories.tsx | Updates story fixtures for new catalog shape. |
| site/src/pages/AgentsPage/AgentCreatePage.tsx | Computes unsupportedProviderNames from the chat models query and passes it to the form. |
| site/src/pages/AgentsPage/AgentChatPageView.tsx | Threads unsupportedProviderNames through the chat page view. |
| site/src/pages/AgentsPage/AgentChatPage.tsx | Computes unsupportedProviderNames and passes it into the page view. |
| site/src/pages/AgentsPage/AgentChatPage.stories.tsx | Updates story catalog fixtures to include unsupported_providers. |
| site/src/modules/aiModels/providerStates.test.ts | Updates catalog fixtures for new unsupported_providers field. |
| site/src/api/typesGenerated.ts | Adds generated types for provider Agents support fields and unsupported provider catalog list. |
| docs/reference/api/schemas.md | Documents new AI provider fields and new unsupported_providers schema. |
| docs/reference/api/chats.md | Updates chat models endpoint example to include unsupported_providers. |
| docs/reference/api/aiproviders.md | Documents new AI provider fields in the providers endpoints. |
| codersdk/chats.go | Adds UnsupportedProviders to ChatModelsResponse and introduces ChatUnsupportedProvider. |
| codersdk/aiproviders.go | Adds Agents support fields and unsupported-reason enum to AIProvider. |
| coderd/x/chatd/chatprovider/chatprovider.go | Adds support detection for Agents + builds unsupported provider list; minor sorting/parsing refactors. |
| coderd/x/chatd/chatprovider/chatprovider_test.go | Adds tests for Agents support detection and unsupported provider list behavior. |
| coderd/exp_chats.go | Attaches unsupported providers to the chat model catalog response for UI empty-state use. |
| coderd/exp_chats_test.go | Adds coverage that Copilot does not appear in supported providers and is surfaced as unsupported. |
| coderd/database/db2sdk/db2sdk.go | Populates AgentsSupported / AgentsUnsupportedReason on AIProvider SDK conversions. |
| coderd/database/db2sdk/db2sdk_test.go | Adds test coverage for AgentsSupported mapping in db2sdk conversion. |
| coderd/apidoc/swagger.json | Updates OpenAPI schema with new AI provider fields and chat catalog unsupported providers. |
| coderd/apidoc/docs.go | Updates embedded OpenAPI doc template with the same schema additions. |
Files not reviewed (1)
- coderd/apidoc/docs.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Not initially, I wanted it to modernize all additions but it went from narrow -> expanded scope. I think the changes are mild enough to ride this PR but can be split out if requested. |
There was a problem hiding this comment.
Clean, well-scoped fix. The single-predicate design is sound: AgentsSupportsProvider wraps the existing NormalizeProvider gate, the parallel UnsupportedProviders field preserves catalog correctness while surfacing what the UI needs, and the three test levels (unit, converter, integration) cover the full stack. Test density at 61% with real play-function stories.
Two P3s, two nits. No blocking issues.
Three reviewers independently noted the coupling between NormalizeProvider and AgentsSupportsProvider: every NormalizeProvider entry must be a type the harness can call without external credential minting. The invariant holds today and the DB enum bounds the risk, but the next editor should know.
Pariston's differential diagnosis is worth quoting: "I tried to build a case against this and couldn't. The premises hold." The four framings (silent drop, conflated abstraction, missing adapter, UI-only fix) each had a clean rebuttal grounded in the code.
🤖 This review was automatically generated with Coder Agents.
cf27548 to
5249bb6
Compare
5249bb6 to
6a4d4ab
Compare
6a4d4ab to
a0eb562
Compare
|
/coder-agents-review |
There was a problem hiding this comment.
Re-review after significant restructuring. The PR adopted human reviewer feedback well: removed per-provider API fields in favor of a codersdk-level enum, simplified the reason type to a plain bool predicate, and added documentation at docs/ai-coder/agents/models.md.
CRF-1 (nil-vs-empty slice): verified fixed. CRF-3 (restating comment): verified fixed. CRF-4 (misleading variable name): verified fixed. CRF-2 (drive-by modernization): panel closed, 5/5 accept. All changes are behavior-preserving and independently reviewable; whether the scope expansion rides this PR is a human reviewer call.
The AgentsUnsupportedProviderType enum design is clean: one type in codersdk drives both the Go predicate and the generated frontend list. Mafuuu noted the enum/switch sync is manual (adding a const without updating the switch would create a frontend-only badge), but for a single-member enum the risk is minimal.
Kite's observation is worth noting: "If copilot is ever added to NormalizeProvider, the explicit unsupported check still blocks it from the Agents harness. Without the enum, that normalization addition would silently make copilot supported." The two-layer check (explicit enum + NormalizeProvider) is defensive in the right direction.
One new nit. No blocking issues.
🤖 This review was automatically generated with Coder Agents.
Configuring only a GitHub Copilot provider left the Agents page stuck on "set up a provider then add a model", even though a provider and models were configured. The catalog silently dropped any provider type that NormalizeProvider could not recognize, so a Copilot-only deployment looked identical to an empty one and never unlocked the page. Copilot is not supported by the Agents harness: it needs a per-request token only an official Copilot client can mint, and the harness is not one. Rather than hide that, compute Agents support from the provider type and surface it. The catalog now reports configured-but-unsupported providers, the model picker omits them, the empty state explains that the configured providers are not supported by Agents and links to AI Settings and the docs, and AI Settings labels them. The providers stay fully 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: the chatd catalog predicate consults it, and the generated AgentsUnsupportedProviderTypes list drives the frontend label. Generated with `coder` agents on behalf of @mafredri.
a0eb562 to
bac9ca5
Compare
A deployment whose only AI provider is GitHub Copilot got stuck on the Agents page: it kept showing "set up a provider then add a model" even with a provider and models configured, and adding a throwaway Anthropic provider was the only way to unlock it. The model catalog silently dropped any provider type it did not recognize, so a Copilot-only setup looked identical to an empty one.
The Agents harness cannot use Copilot, which authenticates with a per-request token only an official Copilot client can mint. So instead of dropping the provider, this surfaces it. Whether Agents can use a provider is derived from its type (no migration), and that one signal drives the UI: the empty state now says the configured providers are not supported by Agents and points to AI Settings, the model picker omits them, and AI Settings labels them. Unsupported providers keep working through the AI Gateway proxy, and nothing is blocked.
Copilot-only: the empty state names the reason instead of asking to set up a provider
AI Settings labels the unsupported provider; supported providers are untouched
With a supported provider, the picker works and omits Copilot
Real Copilot support in Agents needs a swappable harness running an official client and is out of scope (CODAGT-256).
Closes CODAGT-627. Refs CODAGT-256, CODAGT-682.