Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(coderd): clarify error when chat model config is disabled - #27608

#27608
Draft
stirby wants to merge 1 commit into
maincoder/coder:mainfrom
fix/disabled-model-config-error-messagecoder/coder:fix/disabled-model-config-error-messageCopy head branch name to clipboard
Draft

fix(coderd): clarify error when chat model config is disabled#27608
stirby wants to merge 1 commit into
maincoder/coder:mainfrom
fix/disabled-model-config-error-messagecoder/coder:fix/disabled-model-config-error-messageCopy head branch name to clipboard

Conversation

@stirby

@stirby stirby commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #27290

The model_config_id validation in coderd/exp_chats.go returned a single ambiguous message, "Invalid model_config_id: model config not found or disabled.", for both the not-found and disabled-model cases.

Split the shared chatModelConfigUnavailableModelNotFoundOrDisabled reason into chatModelConfigUnavailableModelNotFound and chatModelConfigUnavailableModelDisabled so each maps to a distinct, actionable message:

  • not found: "Invalid model_config_id: model config not found."
  • disabled: "Invalid model_config_id: this model is disabled. Enable it or choose another model."

The provider-disabled and credentials-missing reasons already had their own distinct messages and are unchanged.

Tests: updated the existing disabled-model assertion and added a not-found case under TestPostChats.

Note: the (guarded, should-never-happen) branch for an enabled config with an unset provider FK now maps to the "not found" message rather than introducing a fourth reason for an unreachable state. Happy to add a dedicated message if a reviewer prefers.


This PR was generated by Coder Agents on behalf of @stirby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclear error message when using a disabled AI model config

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.