Repository navigation
refactor(channels): reuse wildcard model matcher - #129125
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 3:50 AM ET / 07:50 UTC. ClawSweeper reviewWhat this changesThe PR deletes a duplicate wildcard-only channel model-override branch so empty candidate lists use the shared direct/parent/wildcard matcher. Merge readinessKeep open: this is a focused, behavior-preserving refactor from a member author, and source review supports the canonical matcher path. Rebase onto current main and require exact-head CI before landing. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherChannel model overrides select a configured model from an incoming conversation’s channel, peer, group, or parent-session identifiers. The selected override feeds agent reply and command model routing. flowchart LR
A[Incoming channel message] --> B[Conversation identifiers]
B --> C[Model override resolver]
C --> D[Shared channel matcher]
D --> E[Direct or parent match]
D --> F[Wildcard match]
E --> G[Selected model route]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -13. Total -13 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical wildcard-resolution path in the shared matcher, then land this deletion after an exact-head rebase and green focused validation. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors an existing resolver rather than reporting a standalone failure; the retained test exercises the relevant wildcard boundary. Is this the best way to solve the issue? Yes: the shared matcher already owns direct, parent, normalized, and wildcard precedence, so removing the special branch avoids policy drift without changing configuration behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ebf07e56e8de. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for exact head
ClawSweeper rank-up move disposition: skip the optional rebase. Current Known proof gap: no live provider/channel credential run. This is intentional and non-blocking because the deletion changes no provider API call, config contract, or channel delivery behavior; the retained owner-boundary regression directly exercises the deleted no-candidate wildcard outcome and metadata. |
|
Merged via squash.
|
What Problem This Solves
channels.modelByChannelwildcard fallback had a second, hand-written resolution branch when a conversation produced no direct or parent candidates. That duplicated wildcard-selection policy already owned by the shared channel-entry matcher and created an unnecessary drift point in channel model routing.Why This Change Was Made
The stale early return is deleted so empty candidate lists flow through
resolveChannelEntryMatchWithFallback, the canonical direct/parent/wildcard matcher. That matcher already returns the wildcard entry withmatchKey: "*"andmatchSource: "wildcard"; model and channel normalization continue through the existing common result path.Rejected alternatives: adding a result-builder abstraction would add production code for the same behavior, while changing direct-match resolution would widen the routing-policy surface. This deletion keeps precedence, plugin-owned candidate construction, config shape, and provider behavior unchanged.
Production LOC: −13 (
+0/−13). Test LOC: 0. No new test was added because the retainedapplies provider wildcard model overrides to direct chatsregression already exercises the exact no-candidate wildcard boundary.User Impact
No user-visible behavior or compatibility change. Operators retain identical direct, group, parent-session, plugin-owned, and wildcard model override behavior with one fewer duplicate routing branch.
Evidence
Exact reviewed head:
481ab0110e7bf3d8a40cd8575e6a64e7423a33fbnode scripts/run-vitest.mjs src/channels/model-overrides.test.ts— 19/19 passed.node scripts/check-changed.mjs -- src/channels/model-overrides.ts— all selected production, typecheck, lint, architecture, and guard lanes passed.git diff --checkand targetedoxfmt --check— passed.src/channels/model-overrides.ts; related session/model PRs own different files and behavior.Credit: investigation and patch authored by Amp for @steipete.