Skip to content

[codex] Fix WebChat agent default model label#77690

Closed
hyspacex wants to merge 1 commit into
openclaw:mainfrom
hyspacex:codex/webchat-agent-default-model-label
Closed

[codex] Fix WebChat agent default model label#77690
hyspacex wants to merge 1 commit into
openclaw:mainfrom
hyspacex:codex/webchat-agent-default-model-label

Conversation

@hyspacex

@hyspacex hyspacex commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resolve the WebChat model selector's Default (...) label from the active agent's configured primary model before falling back to session/global defaults.
  • Keep the active-session row fallback for default-selected sessions when the agents list has not loaded yet.
  • Add regression coverage for an agent-specific default after the selector override cache is cleared.

Root Cause
The selector-state helper built the default option label from sessionsResult.defaults, so a default-selected session for an agent with its own model.primary rendered the global default label even though runtime execution used the agent default.

Reproduction
Before the fix, a selector-state reproduction with a default-selected session, row model openai/gpt-5-mini, and global default openai/gpt-5 returned Default (GPT-5). After the fix it returns Default (GPT-5 Mini).

Verification

  • Reproduced the bad selector-state output before the code change.
  • pnpm test ui/src/ui/chat-model-select-state.test.ts -- --reporter=verbose
  • pnpm exec oxfmt --check --threads=1 ui/src/ui/chat-model-select-state.ts ui/src/ui/chat-model-select-state.test.ts
  • git diff --check
  • pnpm check:changed

Fixes #77440.

@clawsweeper

clawsweeper Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open: current main and the latest release still have the WebChat Default-label bug, and this PR is the linked candidate, but it has a blocking active-agent resolution gap and lacks real WebChat proof.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #77440
Summary: This PR is the direct candidate fix for the linked WebChat active-agent Default-label issue; nearby model-picker items overlap but do not replace it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

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

Yes at source level: current main builds the Default label from global session defaults while agents.list exposes per-agent model.primary data. I did not run a live browser scenario in this read-only review.

Is this the best way to solve the issue?

No. Selector state is the right layer, but the current patch only resolves agent-prefixed keys reliably and needs the same selected/default-agent mapping used by WebChat session controls plus real UI proof.

Security review:

Security review cleared: Security review cleared: the diff is limited to UI selector state, a colocated test, and a changelog line with no dependency, workflow, secret, or package execution changes.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-05-05T04:43:14Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is mock_only and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • steipete: Peter Steinberger extracted chat model selector state and later touched scoped global-agent model controls in the same WebChat boundary. (role: introduced selector structure and adjacent UI owner; confidence: high; commits: 9082795b108b, 4932391e8a78; files: ui/src/ui/chat-model-select-state.ts, ui/src/ui/chat/session-controls.ts)
  • Mulualem Eshetu: Authored merged work preserving configured model metadata in the picker, touching selector state, tests, normalization, and gateway session utilities. (role: adjacent model-picker contributor; confidence: medium; commits: 4977c4ab8221; files: ui/src/ui/chat-model-select-state.ts, ui/src/ui/chat-model-select-state.test.ts, ui/src/ui/chat-model-ref.ts)
  • Serge Koczanowski: Authored active-agent session-picker scoping work near the same WebChat agent/session selection invariant this PR needs to follow. (role: adjacent agent/session UI contributor; confidence: medium; commits: 08b3de003fe7; files: ui/src/ui/chat/session-controls.ts)
  • vincentkoc: Recent history includes session model default checks and session-controls changes adjacent to the selector's default-model source. (role: recent adjacent area contributor; confidence: medium; commits: 29ec5b331c11; files: ui/src/ui/chat/session-controls.ts, src/gateway/session-utils.ts)

Codex review notes: model internal, reasoning high; reviewed against cf36cb915dd6.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 31, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels May 31, 2026
@barnacle-openclaw barnacle-openclaw Bot removed the stale Marked as stale due to inactivity label May 31, 2026
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 28, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 28, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Jul 4, 2026
@steipete steipete self-assigned this Jul 6, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Superseded by #100719, landed as 5f3629e.

The maintainer replacement keeps the valid intent, moves the selected agent's prepared default model through the existing Control UI state boundary, and adds real Chromium coverage for agent switching, session override, clearing, and restored labels. Final validation passed 12 focused state tests, all 25 chat Chromium flows, fresh autoreview, and exact-head hosted CI.

I used a maintainer branch rather than rewriting the contributor fork's default main branch. @hyspacex's contribution is preserved through commit co-authorship, and changelog credit is in #100740. Thank you for finding and fixing the original issue.

@steipete steipete closed this Jul 6, 2026
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 merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: WebChat model selector shows global default instead of agent-specific default model

2 participants