Skip to content

fix: preserve case-sensitive fallback model references - #141997

Merged
shakkernerd merged 1 commit into
mainfrom
fix/fallback-model-identity
Sep 8, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/fallback-model-identity

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Related: #141330, #141953, #141967

What Problem This Solves

Fixes an issue where users entering a case-sensitive fallback model reference could have it rewritten or hidden when the catalog contained a differently cased ID. The field could also offer the primary model again when it was selected through a configured alias.

Why This Change Was Made

Search matching is separated from model identity. Catalog values and labels preserve model suffix case, typed references stay as authored, and primary exclusion uses the current form’s configured aliases with the distinct primary and fallback resolution rules.

User Impact

References such as custom/Model-A and custom/model-a remain separate choices. Users can keep custom references and aliases without an automatic rewrite, while configured primary aliases exclude the matching fallback target.

Evidence

  • All 110 focused selector, agent-display, catalog-label, and overview tests pass. Original case-preservation regressions fail because the old component omits the case-distinct Add row.
  • Built Control UI at 3fc9dd3f1e1a3cb04958f19cf7f3a11adcd9169f with the maintained stateful mock Gateway: all 12 browser cases pass config/raw readback. These cover exact custom case through Add/Enter/comma, distinct catalog labels, primary aliases and per-agent overrides, explicit clipboard confirmation, retained alias bindings, and bare/profile-qualified alternatives.
  • Remote formatting, lint, UI production/test types, assertion-safety, and line-ratchet checks pass. CI and required aggregate pass on the same head.

Visual evidence

View Before After
Custom model suffix case is preserved Original fallback behavior with the same synthetic model setup Corrected fallback behavior with the same synthetic model setup
Case-distinct fallback remains available beside the primary Original fallback behavior with the same synthetic model setup Corrected fallback behavior with the same synthetic model setup

Exact-head fallback interaction recording

proof.webm

Visual verification

  • Baseline: 6627766
  • Exact head: 3fc9dd3f1e1a3cb04958f19cf7f3a11adcd9169f
  • Scenario: Explicitly add a case-distinct custom reference and add that same reference beside its lowercase primary; validate alias, catalog label, and clipboard alternatives.
  • Runtime/build: Node v24.19.0; Chromium 144.0.7559.0; UI index SHA256 fda4aeb1dddf6ea9a0db4e9c61734bd9ffdd4fd86162d516f2b52dd3ba748960
  • Authored suffix case: custom/Model-A is saved exactly through Add, Enter and comma.
  • Distinct identities: Lowercase and uppercase catalog entries and labels remain distinct; case-distinct fallback is allowed beside primary model-a.
  • Aliases and alternatives: Primary alias/profile exclusion, per-agent override, authored alias/CSV, bare and profile-qualified alternatives pass config.set readback.
  • Clean exact-head source and emitted UI index/assets verified
  • Retained original audit baseline reused after all eight component/caller/config owner hashes matched the selected base
  • Same viewport, dark theme, en-US and equivalent Model Selection framing
  • Assertions cover actual stateful mock config.set payload plus config/raw readback
  • Original screenshots and source recordings retained
  • All comparison screenshots and the complete recording sequence were inspected; inputs, cues and settled results are readable and contain only synthetic data.

@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 4:24 AM ET / 08:24 UTC.

ClawSweeper review

What this changes

The Control UI preserves case-sensitive fallback model references and catalog labels while using configured aliases to exclude the effective primary model.

Merge readiness

✅ Ready for maintainer review

This remains a useful repair: current main still conflates case-distinct fallback references, and the related PRs address separate defects. No blocking correctness or security finding remains.

Priority: P2
Reviewed head: 3fc9dd3f1e1a3cb04958f19cf7f3a11adcd9169f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported repair with useful visual evidence and regression coverage, with no blocking finding.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after captures of the built Control UI show the changed picker retaining custom/Model-A and allowing it beside the lowercase primary; the captured body ties these scenarios to the reviewed head and reports stateful mock-Gateway configuration readback.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after captures of the built Control UI show the changed picker retaining custom/Model-A and allowing it beside the lowercase primary; the captured body ties these scenarios to the reviewed head and reports stateful mock-Gateway configuration readback.
Evidence reviewed 9 items Current main still needs the repair: At the fetched main revision, option matching, exclusions, and typed-value replacement still lowercase whole model references, conflating custom/Model-A with custom/model-a.
Existing configuration identity contract: The shared configuration normalizer preserves arbitrary model suffix case while normalizing the provider and established provider-specific aliases. The PR reuses this contract for picker identity.
Alias resolution boundary: Compared primary and fallback exclusion against the runtime’s distinct configured-primary and fallback alias precedence, including per-agent overrides and profile stripping. The changed code performs UI filtering; it does not grant credential access or change authorization.
Findings None None.
Security None None.

How this fits together

The agent model picker combines the Gateway catalog with editable agent configuration. Selected fallback references pass through the existing configuration writer and determine the agent’s ordered fallback chain.

flowchart LR
  A[Gateway model catalog] --> C[Model choices and labels]
  B[Agent configuration draft] --> C
  B --> D[Primary alias exclusion]
  C --> E[Fallback picker]
  D --> E
  F[Typed model references] --> E
  E --> G[Ordered configuration update]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +109, Tests +396. Total +505 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 139 30 +109
Tests 4 400 4 +396
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 539 34 +505

Review metrics

Metric Value Why it matters
Production versus regression coverage production +109 net lines; tests +396 net lines Production growth chiefly implements draft-aware primary exclusion; the added tests cover distinct identity, alias, and interaction contracts.

Technical review

Best possible solution:

Keep model identity aligned with the existing configuration normalizer while preserving authored fallback values and case-insensitive search.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: a lowercase catalog entry causes current main to match or exclude a differently cased custom reference. The supplied before/after screenshots corroborate this; no local execution was performed.

Is this the best way to solve the issue?

Yes. Caller-owned identity reuses the existing configuration normalizer, preserves typed values, and keeps model-specific exclusion outside the generic component.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 299ea7c393b8.

Labels

Label justifications:

  • P2: Repairs incorrect fallback selection for case-sensitive model references in a bounded configuration UI.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after captures of the built Control UI show the changed picker retaining custom/Model-A and allowing it beside the lowercase primary; the captured body ties these scenarios to the reviewed head and reports stateful mock-Gateway configuration readback.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after captures of the built Control UI show the changed picker retaining custom/Model-A and allowing it beside the lowercase primary; the captured body ties these scenarios to the reviewed head and reports stateful mock-Gateway configuration readback.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after captures of the built Control UI show the changed picker retaining custom/Model-A and allowing it beside the lowercase primary; the captured body ties these scenarios to the reviewed head and reports stateful mock-Gateway configuration readback.

Evidence

What I checked:

  • Current main still needs the repair: At the fetched main revision, option matching, exclusions, and typed-value replacement still lowercase whole model references, conflating custom/Model-A with custom/model-a. (ui/src/components/multi-select.ts:96, 299ea7c393b8)
  • Existing configuration identity contract: The shared configuration normalizer preserves arbitrary model suffix case while normalizing the provider and established provider-specific aliases. The PR reuses this contract for picker identity. (src/config/model-input.ts:63, 3fc9dd3f1e1a)
  • Alias resolution boundary: Compared primary and fallback exclusion against the runtime’s distinct configured-primary and fallback alias precedence, including per-agent overrides and profile stripping. The changed code performs UI filtering; it does not grant credential access or change authorization. (ui/src/lib/agents/display.ts:397, 3fc9dd3f1e1a)
  • Inspected visual evidence: Inspected all four downloaded screenshots. The after images visibly retain custom/Model-A, including beside a lowercase primary where the before image has no fallback. The captured PR body identifies the reviewed head, built Chromium UI, and stateful mock-Gateway config readback scenarios. No provider execution is claimed. (3fc9dd3f1e1a)
  • Focused regression coverage: Read all four changed test files. Coverage exercises case-distinct Add/Enter/comma interactions, unchanged authored aliases, catalog labels, and caller wiring. The reported 110 passing tests were not rerun during this read-only review. (ui/src/components/multi-select.test.ts:248, 3fc9dd3f1e1a)
  • Merged feature history: History and the raw-parent comparison connect the existing picker to the merged feature at feat: choose agent fallback models from a searchable dropdown #141330; the comparison shows the component was added there. (ui/src/components/multi-select.ts:184, 2c31287b8326)

Likely related people:

  • Shakker: Raw commit 2c31287 adds ui/src/components/multi-select.ts:178 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2c31287b8326; files: ui/src/components/multi-select.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-08T07:50:47.045Z sha 3fc9dd3 :: needs maintainer review before merge. :: none

@shakkernerd shakkernerd self-assigned this Sep 8, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 8, 2026
@shakkernerd
shakkernerd merged commit 28f5187 into main Sep 8, 2026
142 checks passed
@shakkernerd
shakkernerd deleted the fix/fallback-model-identity branch September 8, 2026 09:01
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: fallback model selection preserves exact references and correctly excludes configured primary aliases.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
Preserve case-sensitive fallback model references and authored aliases, and exclude configured primary aliases using current form values.

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

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant