Skip to content

fix(ui): show active session model in composer - #138076

Merged
fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:fix/composer-session-model
Sep 4, 2026
Merged

fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:fix/composer-session-model

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The composer model trigger stayed on the configured model even when the session was actively running a fallback model. That made the control disagree with the model actually producing responses.

Closes #93346.

Why This Is the Right Approach

  • Preserve model / modelProvider as the selected preference so existing callers and picker selection semantics do not change.
  • Project a separate active model pair from the authoritative persisted fallback state only while it matches the current selected and runtime models.
  • Render the active pair in the closed composer trigger, while keeping the configured preference selected inside the picker.
  • Keep an in-flight local selection visible immediately until the session row confirms the runtime state.

This is additive (+32 production LOC) because selected and active models are distinct facts. No legacy path was removed or silently redefined.

User Impact

When a session falls back, the composer now names the model actually serving the session. Opening the picker still shows the user's configured model as selected. When the fallback clears, the trigger returns to the configured model.

Evidence

Before: the trigger remains on the configured GPT-5.5 model while the session is actively using Qwen.

Before: composer trigger shows GPT-5.5 despite active Qwen fallback

After: the trigger shows Qwen 3.5 9B, while the picker retains GPT-5.5 as the configured preference.

After: composer trigger shows active Qwen 3.5 9B model

Validation

  • pnpm check
  • pnpm build
  • pnpm protocol:check
  • pnpm test packages/gateway-protocol/src/schema/sessions-row.test.ts (6 passed)
  • pnpm test src/gateway/session-utils.test.ts (235 passed)
  • pnpm test ui/src/pages/chat/chat-view.test.ts (358 passed)
  • pnpm test ui/src/e2e/chat-composer-catalog.e2e.test.ts -t "shows the active fallback model" (1 passed, 10 skipped)

The broad local repository run reached unrelated environmental failures and was stopped after the focused projects completed: two long-temp-path failures passed when rerun under /tmp; an untouched sandbox browser config-hash test still reproduces independently. Required CI remains the merge gate.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 4, 2026 08:18
@fuller-stack-dev
fuller-stack-dev force-pushed the fix/composer-session-model branch from cde38df to b894896 Compare September 4, 2026 08:25
@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 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 5:10 AM ET / 09:10 UTC.

ClawSweeper review

What this changes

The PR projects an active fallback model into Gateway session rows and uses it for the Control UI composer label while retaining the selected model inside the picker.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this MEMBER-authored PR open for normal merge review. The patch cleanly separates the selected preference from the verified active fallback state, so the composer can report the serving model without changing picker selection semantics; no blocking correctness or security defect was found.

Priority: P2
Reviewed head: b8948967eef2d862c3d0a1ff598be9c1edb6b3ba

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A normal good bug-fix patch: the owner boundary, additive protocol contract, picker semantics, and focused coverage align without a supported blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable: the external-contributor proof gate does not apply to this MEMBER-authored PR. The body supplies before/after screenshot links and focused validation claims; DNS prevented independent artifact retrieval in this review environment without changing this classification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable: the external-contributor proof gate does not apply to this MEMBER-authored PR. The body supplies before/after screenshot links and focused validation claims; DNS prevented independent artifact retrieval in this review environment without changing this classification.
Evidence reviewed 7 items Current-main premise: Current main projects only the selected display model into a session row; it has no active fallback-model projection, so the reported display mismatch remains relevant.
Fallback-state owner: Agent-run accounting derives a fallback transition from selected and runtime models, then persists its selected/active pair on the session entry; the PR reuses that owner state rather than inferring runtime identity in the UI.
Guarded Gateway projection: The new row values are emitted only when the persisted fallback notice still matches both the resolved selected and active runtime references, preventing stale fallback notices from being displayed.
Findings None None.
Security None None.

How this fits together

Agent-run accounting records the selected and active model when fallback occurs, and the Gateway projects that state into session rows. The Control UI consumes the rows to show the active serving model in the composer while its picker remains a preference editor.

flowchart LR
  A[Fallback transition] --> B[Persisted session state]
  B --> C[Gateway session row]
  C --> D[Control UI session state]
  D --> E[Composer active-model label]
  D --> F[Picker selected preference]
Loading

Before merge

  • Resolve merge risk (P1) - The bug fix adds production net +32 lines plus +8 generated Swift binding lines; that growth is justified by carrying two distinct protocol facts, and the inspected model-selection fields cannot represent active runtime state without changing picker semantics.
Agent review details

Security

None.

PR surface

Source +32, Tests +153, Other +8. Total +193 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 40 8 +32
Tests 4 153 0 +153
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 8 0 +8
Total 9 201 8 +193

Review metrics

Metric Value Why it matters
Production versus test delta production +40 net (+32 source, +8 generated Swift); tests +153 The added protocol facts and UI rendering have focused Gateway, unit, and browser coverage; the source growth is tied to retaining distinct selected and active model meanings.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #93346
Summary: This PR is a direct candidate fix for the linked selected-versus-active-model display mismatch.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the additive selected-versus-active session-row contract and merge once the exact-head required checks complete; no migration or compatibility fallback is needed because the new fields are optional.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the additive selected-versus-active session-row contract and merge once the exact-head required checks complete; no migration or compatibility fallback is needed because the new fields are optional.

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

Yes, source-reproducible: current main emits only the selected model while the established fallback owner records a distinct active model; the added browser test exercises the selected-versus-active session-row scenario.

Is this the best way to solve the issue?

Yes. Reusing the validated persisted fallback transition at the Gateway boundary and projecting a separate optional pair is the narrowest maintainable fix; changing the picker selection would conflate two distinct facts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This fixes a misleading Control UI model label with limited blast radius and no evidence of delivery, data, or authorization impact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable: the external-contributor proof gate does not apply to this MEMBER-authored PR. The body supplies before/after screenshot links and focused validation claims; DNS prevented independent artifact retrieval in this review environment without changing this classification.

Label justifications:

  • P2: This fixes a misleading Control UI model label with limited blast radius and no evidence of delivery, data, or authorization impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable: the external-contributor proof gate does not apply to this MEMBER-authored PR. The body supplies before/after screenshot links and focused validation claims; DNS prevented independent artifact retrieval in this review environment without changing this classification.

Evidence

What I checked:

Likely related people:

  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@fuller-stack-dev
fuller-stack-dev merged commit a45508f into openclaw:main Sep 4, 2026
226 of 231 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Model dropdown does not reflect effective runtime model after fallback/default drift

1 participant