refactor(coderd/x/chatd): unify model override resolution - #28754
refactor(coderd/x/chatd): unify model override resolution#28754ibetitsmike wants to merge 3 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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, andmodel_routing.gowas a single-adapter indirection.This extracts one resolver,
(*Server).resolveModelOverride(ctx, modelOverrideSpec)inmodel_override.go, parameterized by per-check failure mode (soft skips or falls back with a log, hard errors).title_override.go,compaction_override.go, andmodel_routing.goare deleted; call sites keep feeding results intomodelCallSpec.explicitConfigexactly 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.