Skip to content

[Bug]: WebChat + New Session displays default model but inherits parent's model override #86174

Closed

Description

@rqlangley

Bug type

Behavior bug (incorrect output/state without a crash)

Beta release blocker

No

Summary

In Control UI WebChat, + New Session can show Default (<configured default model>) in the model picker while the first message is actually routed through the previously selected parent session's non-default model override.

Steps to reproduce

  1. Configure the default model as model A.
  2. In an existing WebChat dashboard session, select a different model B and send a message so that session persists a user model override.
  3. While that session is selected, click + New Session.
  4. Observe that the new session's model picker displays Default (model A).
  5. Send the first message without changing the displayed picker selection.
  6. Inspect the model used for that run or the new session's trajectory.

Expected behavior

A new session that displays Default (model A) should route its first message to model A, or the UI should visibly show that it will inherit model B before the user sends a message.

Selecting the configured default in the new session should also provide a way to override any inherited parent model choice.

Actual behavior

The new session routes its first message to model B, even though its picker displays Default (model A).

In an observed run on OpenClaw 2026.5.19, the child session's first runtime event and all subsequent events used the parent's non-default model. There was no request to the configured default model and no fallback event.

Environment

  • OpenClaw version: 2026.5.19
  • UI/channel: Control UI WebChat dashboard
  • Install method: npm global
  • OS: Linux
  • Models: reproduced with configured default openai/gpt-5.5 and parent override qwen/qwen3.6-plus
  • Routing: direct configured providers; no proxy/router needed to reproduce

Evidence and apparent cause

Inspection of the installed 2026.5.19 distribution shows:

  • The + New Session control calls sessions.create with the currently selected dashboard session as parentSessionKey.
  • The newly created child has no direct modelOverride; the picker therefore renders the configured default label.
  • The first chat.send does not carry the displayed picker model.
  • Runtime stored-model resolution falls back to the parent's persisted override when the child has no direct override.
  • When the user chooses a model that equals the configured default, sessions.patch clears direct override fields rather than storing an explicit child-level "use default" selection, so the parent override continues to win.

This creates a user-visible mismatch: the model picker says the next request will use the default model, but effective routing uses the parent model.

Impact and severity

  • Affected users: Control UI WebChat users who create a session while viewing a session with a non-default model override.
  • Severity: moderate; requests silently run on an unexpected model/provider.
  • Frequency: deterministic under the reproduction steps above.
  • Consequence: unexpected subscription/quota usage, cost/capability changes, and misleading diagnosis as a provider fallback or outage.

Related issues

Suggested behavior

Any of the following would avoid silent misrouting:

  • Create a genuinely independent new session from + New Session, unless inheritance is explicitly requested.
  • Represent and display the effective inherited model in the child session picker.
  • Support an explicit child-level "use configured default, do not inherit parent override" state.

Activity

  1. clawsweeper commented on May 24, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed September 6, 2026, 11:42 AM ET / 15:42 UTC.

    Summary
    Keep open: selecting Default still clears the child’s selection and permits the parent’s model override to win. Untouched-child inheritance has improved, but the remaining defect is already owned by the linked open repair PR.

    Reproducibility: yes. by source inspection: create a child of a parent pinned to model B, select Default A, then resolve the next turn; clearing the child override exposes B again. No runtime reproduction was executed in this read-only review.

    Next step
    Review and resolve #131805 before closing this issue; another repair PR would duplicate active work.

    Review details

    Best possible solution:

    Persist explicit Default intent across session lifecycle operations and use the same effective selection for display and routing while preserving untouched-child inheritance.

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

    Yes, by source inspection: create a child of a parent pinned to model B, select Default A, then resolve the next turn; clearing the child override exposes B again. No runtime reproduction was executed in this read-only review.

    Is this the best way to solve the issue?

    Yes, durable Default intent at the shared selection owner is the appropriate repair direction. The linked PR addresses that boundary; preserving concrete pins equal to the default is a separate documented-contract change.

    AGENTS.md: found and applied where relevant.

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

    Label changes

    Label justifications:

    • P2: The defect silently selects an unexpected model in a bounded child-session workflow without blocking general chat availability.
    • impact:session-state: Clearing a child’s direct model selection loses the user’s intent to stop inheriting its parent’s pin.
    • impact:auth-provider: The next turn can use the parent’s provider/model despite the user selecting Default.
    Evidence reviewed

    What I checked:

    • Default selection loses inheritance intent: The UI sends model:null for Default. Gateway patch handling marks that selection as default, and the shared writer deletes providerOverride, modelOverride, and modelOverrideSource without recording a barrier to parent inheritance. (src/sessions/model-overrides.ts:71, 9d20f0b07acc)
    • Runtime still inherits after the direct selection is cleared: resolveStoredModelOverride falls through to the parent when no direct override exists; only active automatic fallback provenance suppresses inheritance. get-reply passes the persisted parentSessionKey, and reply model selection consumes the resulting override. (src/sessions/stored-model-overrides.ts:91, 9d20f0b07acc)
    • Untouched child behavior has improved: Session creation copies eligible parent selection fields when no explicit model was supplied. The UI now reads the active session model and override provenance, so the original untouched-child display mechanism is no longer the whole remaining problem. (src/gateway/session-create-service.ts:1335, 9d20f0b07acc)
    • Latest-release and current-main checks: The v2026.9.2 tag resolves to 3928bad and contains both default-selection clearing and parent fallback. The checkout is two commits behind fetched main; a name-only comparison confirms those commits do not change the inspected selection owners. No complete fix was established. (src/sessions/model-overrides.ts:71, 3928bad9badf)
    • Existing implementation candidate: The supplied GitHub snapshot formally links fix: keep new-session model display and routing aligned #131805 as an open closing PR. Its body describes durable explicit-Default provenance and reports real Gateway restart/provider-turn evidence. This establishes active ownership, not merge approval. A live gh refresh failed because api.github.com was unreachable. (b5fd4b78c258)
    • Recent discussion distinguishes an additional request: The July report documents Default clearing followed by parent routing. The September v2026.9.2 report adds useful persistence observations and proposes retaining concrete pins equal to the configured default. Current documentation explicitly says selecting that default by name clears the pin, so changing that separate contract should not be silently added to the inheritance repair. Public docs: docs/concepts/models.md. (docs/concepts/models.md:283, 9d20f0b07acc)

    Likely related people:

    • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    How this review workflow works
    • 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.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on May 24, 2026
  3. kumaxs commented on Jun 10, 2026

    @kumaxs
    Contributor

    Additional reproduction: WebChat shows wrong model in session header

    Session UI (webchat) displays the configured default model (M3) in the chat box footer, but the actual session is running a different model (M2.7). Verified via session_status which shows minimax/MiniMax-M2.7 as the actual model.

    Layer What is shown What is actual
    UI footer M3 (default model from config) —
    session_status — M2.7 (actual model used)
    Session metadata — model: MiniMax-M2.7

    Environment: OpenClaw 2026.6.1, webchat channel
    Expected fix: UI should display the actual model from session metadata, not the configured default.

  4. added
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 19, 2026
  5. NowHeaven commented on Jul 24, 2026

    @NowHeaven

    Confirmed and root-caused on OpenClaw 2026.7.1-2 (npm global, Windows x64). The original report describes the exact issue; here's code-level evidence.

    Reproduction verified live

    1. Parent dashboard session: override kimi/k3 (user)
    2. + New Session → child created with parentSessionKey = parent
    3. Child model picker shows Default (deepseek/deepseek-v4-pro)
    4. Select "V4 Pro" → WS frame captured: sessions.patch payload = {"model":"deepseek/deepseek-v4-pro"} — correct
    5. Store: override fields ALL deleted (isDefault optimization)
    6. Next run dispatches to kimi/k3 — parent's non-default override wins

    Root cause: two-path semantic conflict

    Path A — projectSessionsPatchEntry (session-create-service-*.js): resolved model == configured default → isDefault=true → deletes all override fields and runtime cache. Semantics: "no override = use default".

    Path B — resolveStoredModelOverride (stored-model-override-*.js):

    // 1. session's own override → source:"session"
    const direct = ...(entry.providerOverride/modelOverride);
    if (direct) return {...direct, source:"session"};
    // 2. parent chain fallback → source:"parent"
    const parentKey = resolveParentSessionKeyCandidate({sessionKey, parentSessionKey});
    const parentEntry = sessionStore[parentKey];
    const parentOverride = ...(parentEntry.providerOverride/modelOverride);
    return parentOverride ? {...parentOverride, source:"parent"} : null;

    Path B says "no override = inherit parent". For sessions with parentSessionKey, selecting the configured default can never reach the default — the parent override always shadows it. Non-default models work fine (write direct source:"session" override).

    Observed parent chain

    dcf8f779 → 1212b97e(override=kimi/k3, source:user) → 70274004(debug session: override cleared, dispatches kimi/k3)

    Fix suggestion

    A) resolveStoredModelOverride skip inheritance when child has provenance indicating explicit set/clear.
    B) Patch path write explicit child override (source:"user") when default+parent override exist, instead of deleting.

    Dist code locations (2026.7.1)

    • stored-model-override-[hash].js: resolveStoredModelOverride — parent chain fallback
    • session-create-service-[hash].js: projectSessionsPatchEntry — isDefault clearing
    • dispatch-[hash].js: resolveStoredModelCandidate — dispatch entry point
    • live-model-switch-[hash].js: resolveLiveSessionModelSelection — no parent walk (third inconsistent path)

    Secondary UX

    Selector silently disabled during active runs with zero feedback.

  6. 15 remaining items

  7. added
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    and removed
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Aug 29, 2026
  8. wpu911 commented on Sep 6, 2026

    @wpu911

    Confirmed on released OpenClaw 2026.9.2 on Windows (npm global) with a local OpenAI-compatible provider. I reproduced an additional persistence edge of the same model-selection intent problem.

    Reproduction (no inference required)

    Configured default:

    • local-llm/qwen3.8-27b:256k

    Parent dashboard session explicitly pinned to:

    • local-llm/qwen3.6-35b:256k

    Then create a child with parentSessionKey=<parent> and explicitly request the concrete configured-default model local-llm/qwen3.8-27b:256k.

    Before my local patch, sessions.create returned the child as resolved to qwen3.8, but the persisted entry did not contain:

    • providerOverride
    • modelOverride
    • modelOverrideSource

    A subsequent session projection showed model=qwen3.8-27b:256k with modelOverrideSource=null.

    So a concrete user choice that happens to equal the configured default is collapsed into "no direct selection". That loses the distinction between these two intents:

    1. Use this exact model for this session
    2. Follow the configured default

    That distinction matters when the configured default later changes, and it also matters for parent/child selection semantics.

    Local validation of the intended semantics

    I patched the installed 2026.9.2 bundle so that a concrete model selection remains a user pin even if it currently equals the configured default, while an explicit Default / model:null remains the operation that clears the direct pin.

    After the patch, creating the same child with explicit qwen3.8 persisted:

    providerOverride      = local-llm
    modelOverride         = qwen3.8-27b:256k
    modelOverrideSource   = user
    modelOverrideRouteResolution = resolved
    

    I also tested parent/child independence in both directions using empty dashboard sessions:

    • Parent 3.6 -> 3.8 did not change child's explicit 3.6 pin.
    • Child 3.6 -> 3.8 did not change parent's explicit 3.6 pin.
    • Explicit model:null still cleared the direct override.

    Why this seems relevant to #131805

    The important invariant is that target identity is not the same thing as user intent. selected model == configured default should not by itself imply "follow default". A concrete model selection should remain concrete; an explicit Default action should carry the follow-default semantics/provenance.

    PR #131805 appears aligned with this broader intent separation for child/default inheritance. The 2026.9.2 release still reproduces the persistence ambiguity described above.

  9. wpu911 commented on Sep 8, 2026

    @wpu911

    Confirmed on OpenClaw 2026.9.2 (Windows) with real downstream request captures

    I can still reproduce this on OpenClaw 2026.9.2 on Windows 10 x64 / Node.js v22.23.2.

    My setup uses the Control UI WebChat dashboard with an OpenAI-compatible local model provider. The configured default model is:

    local-llm/ornith-1.5-35b:256k
    

    The parent dashboard session had an explicit user override:

    local-llm/qwen3.6-35b:256k
    

    A child dashboard session was shown / intended to use the default model, but the actual downstream request capture was:

    Runtime:
    model=local-llm/qwen3.6-35b:256k
    default_model=local-llm/ornith-1.5-35b:256k
    
    Outgoing OpenAI-compatible request:
    "model": "qwen3.6-35b:256k"
    

    So this was not a provider/router alias problem. OpenClaw itself resolved and sent the parent's Qwen3.6 override.

    Root cause observed locally

    The installed 2026.9.2 bundle still walks parentSessionKey from stored-model override resolution when the current dashboard child has no direct model override.

    Effectively:

    child has no direct model override
            ↓
    resolve parentSessionKey
            ↓
    inherit parent's persisted user model override
            ↓
    parent model wins over configured default
    

    This matches the behavior described in this issue.

    Local production hotfix

    For testing, I applied a narrow local patch in the bundled stored-model-override resolver so that an operator-created dashboard child session with no direct model override does not revive a parent dashboard's user override, and instead resolves to the configured default.

    I intentionally did not remove parent-model inheritance globally. Explicit spawn/subagent inheritance behavior was left untouched.

    After clearing the child's direct override, session state became:

    parent:
      model = local-llm/qwen3.6-35b:256k
      modelOverrideSource = user
    
    child:
      model = local-llm/ornith-1.5-35b:256k
      modelOverrideSource = null
    
    configured default:
      local-llm/ornith-1.5-35b:256k
    

    The parent's own user override remained unchanged.

    Real request verification

    First chat.send after the patch:

    actual request model = ornith-1.5-35b:256k
    runtime model = local-llm/ornith-1.5-35b:256k
    default_model = local-llm/ornith-1.5-35b:256k
    prompt_tokens = 82962
    completion_tokens = 61
    reply = MODEL_FIX_OK
    

    Second consecutive chat.send on the same child session:

    actual request model = ornith-1.5-35b:256k
    cache_tokens = 82960
    input_tokens = 57
    output_tokens = 21
    duration_ms = 2130
    reply = MODEL_FIX_2_OK
    

    The second turn is useful evidence because it proves both that the child stayed on Ornith instead of falling back to the parent's Qwen3.6 override, and that the Ornith KV prefix was reused normally on the next turn.

    Relation to PR #131805

    I also found the open fix PR: #131805 fix: keep new-session model display and routing aligned.

    That PR takes a more complete product-level approach than my emergency local patch: it preserves intentional inherited-child behavior, makes the effective inherited model visible, and treats an explicit Default selection as a durable barrier to parent inheritance.

    So I am not proposing my bundled hotpatch as the exact upstream implementation. I am posting this as additional runtime confirmation that:

    1. the bug is still reproducible in released 2026.9.2;
    2. the incorrect model selection originates in OpenClaw session/model resolution, not the downstream provider;
    3. preventing stale parent override resolution for this dashboard-child case immediately restores correct routing in real requests.

    The key invariant should be: the model shown/selected in Control UI must match the model that will actually handle the next request.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions