Skip to content

refactor(coderd/x/chatd): unify model override resolution - #28754

Open
ibetitsmike wants to merge 3 commits into
mainfrom
mike/chatd-override-resolver
Open

refactor(coderd/x/chatd): unify model override resolution#28754
ibetitsmike wants to merge 3 commits into
mainfrom
mike/chatd-override-resolver

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

Four chatd flows (title generation, compaction, subagent spawn, advisor) each carried their own copy of the organization model-override resolution: the same override query, config lookup, provider/credential checks, and soft/hard failure classification, with four near-identical mock failure matrices in tests. The shared core hid in subagent.go, and model_routing.go was a single-adapter indirection.

This extracts one resolver, (*Server).resolveModelOverride(ctx, modelOverrideSpec) in model_override.go, parameterized by per-check failure mode (soft skips or falls back with a log, hard errors). title_override.go, compaction_override.go, and model_routing.go are deleted; call sites keep feeding results into modelCallSpec.explicitConfig exactly as before. The four per-flow test matrices collapse into one table-driven matrix (model_override_internal_test.go, 4 flows x 7 scenarios); per-flow tests keep only flow-specific behavior. Behavior preserving: semantics, event ordering, and error classification are unchanged.

Net diff: 692 insertions, 1,832 deletions (-1,140 lines) across prod and tests.

Dogfood UAT ran on a dev deployment against this branch and passed: all four flows served by a cross-provider org override with serving-model evidence, plus disabled-provider, disabled-config, broken-credential, and invalid-config fallback phases matching documented semantics.

Disclosure: Xum (an AI coding agent) authored this PR on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T11:37:30.213859Z 9d511e1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fc1083686

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/model_override.go
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 9d511e1d2e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant