Skip to content

fix(status): usage follows session model after switch#93384

Merged
obviyus merged 2 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/issue-93322
Jun 25, 2026
Merged

fix(status): usage follows session model after switch#93384
obviyus merged 2 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/issue-93322

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

What problem does this PR solve?

Fixes an issue where a session pinned with /model openai/gpt-5.5 could show OpenAI as the selected model while /status still resolved usage, auth, harness, and context metadata through the configured default DeepSeek provider. It also fixes the stale-runtime path where persisted runtime state can still reference DeepSeek after a manual session model switch; usage now follows the selected session model unless the active runtime is authoritative through explicit automatic model handoff provenance, an existing active fallback notice, or an equivalent runtime alias. Active fallback notices now also keep the live runtime context window when the fallback model is not resolvable from config, instead of falling back to a stale selected-model context window. The root cause was that status lookup treated the configured or stale active provider/model as the source for provider-specific metadata after the session had a selected-model override; this PR moves the resolver boundary to the selected session model and explicit runtime provenance instead of patching the rendered status text downstream.

Why does this matter now?

This PR was already carrying the selected-model status routing fix, and the first blocker was introduced by this PR's new regression fixture: the OpenAI provider config used by the provider-qualified override test omitted the required ModelProviderConfig.baseUrl. After that was fixed, ClawSweeper identified one remaining author-side gap: /status usage could still query the stale active runtime provider when sessionEntry.modelProvider/model lagged behind a user-pinned session model.

What is the intended outcome?

Root-cause fix. /status should keep the configured default visible for new or unpinned sessions, but provider-specific lookup for a pinned session should use the selected provider/model. If active runtime differs because of a real automatic model handoff, an existing active runtime-handoff notice, or an equivalent runtime alias, status can still use active-runtime usage/auth and context metadata. If active runtime differs only because stored runtime state is stale after a manual switch, usage follows the selected session provider. When an active runtime-handoff notice points at a runtime model that is not in config, /status now trusts the live runtime context snapshot instead of a stale selected-model context window. The typecheck blocker is fixed at the canonical fixture boundary by giving the new OpenAI provider fixture the same required baseUrl shape used by the existing OpenAI/Codex provider config, not by weakening types or changing runtime behavior.

What is intentionally out of scope?

Out of scope: changing model selection semantics, provider credentials, config defaults, migrations, automatic runtime handoff behavior, external usage APIs, schema shape, or compatibility defaults. This update does not add a new public contract; it keeps the existing public contract surface for session overrides and model provider config intact.

What does success look like?

A pinned direct session can run /model openai/gpt-5.5 and then /status; the status card shows Configured default: deepseek/deepseek-v4-flash, Session selected: openai/gpt-5.5, OpenAI context metadata, and no DeepSeek balance text. A stale runtime snapshot with selected OpenAI and active DeepSeek also loads usage for openai, not deepseek. An unresolved active fallback notice with live contextTokens: 123456 and stale persisted selected-window contextTokens: 1048576 renders Context: 49k/123k, not Context: 49k/1.0m. pnpm check:test-types passes on the current head.

What should reviewers focus on?

Review the source-of-truth boundary: selected session model resolution should happen before status usage/auth/context lookup, not as a renderer-only post-process. Also review the stale-runtime distinction: active-runtime usage and context metadata are preserved for explicit automatic handoff provenance, active fallback notices, or equivalent runtime aliases, while manual selected-model overrides are not overwritten by stale sessionEntry.modelProvider/model state. The only config fixture correction is the required baseUrl on the OpenAI test provider. Related #93829 also touches status model/provider resolution; this update keeps #93384 scoped to the existing #93322 selected-session status routing path and does not broaden the resolver contract.

Linked context

Which issue does this close?

Closes #93322

Which issues, PRs, or discussions are related?

Related #93384

Related #93829 (overlapping open PR noted; this PR stays scoped to #93322's selected-session status routing fix and avoids broad resolver-contract changes).

Was this requested by a maintainer or owner?

ClawSweeper flagged the status routing risk, stale-runtime usage gap, CI/typecheck state, and optional visible /model then /status proof; this update addresses those author-side items.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: /status now keeps the configured default line on DeepSeek while resolving the session-selected model, context metadata, and usage/provider decision from OpenAI after a session is pinned to openai/gpt-5.5.

  • Real environment tested: Existing before-fix Telegram direct session evidence from [Bug]: /status usage should follow session-selected model after /model switch #93322 on OpenClaw 2026.6.6; retained after-fix Node status-renderer proof against the patched source; and current-head after-fix qa-channel proof using qa-channel + qa-lab bus + real OpenClaw gateway child + mock-openai provider with configured default deepseek/deepseek-v4-flash and session selection openai/gpt-5.5.

  • Exact steps or command run after this patch: Retained renderer proof: OPENAI_API_KEY= DEEPSEEK_API_KEY= node --import tsx --input-type=module <status-renderer proof script>. Current channel proof: daily_fix run-validation --name qa-channel-model-status-proof-round2 -- pnpm exec tsx <qa-channel-model-status-proof.ts>.

  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output):

    Evidence after fix (qa-channel-model-status-proof):
    - Started qa-channel + qa-lab bus + real gateway child + mock-openai provider.
    - Injected /model openai/gpt-5.5, then /status in the same direct conversation.
    - /model ack: Model set to openai/gpt-5.5 for this session.
    - /status excerpt:
      🧠 Configured default: deepseek/deepseek-v4-flash
      📌 Session selected: openai/gpt-5.5 · 🔑 api-key (models.json)
      📚 Context: ?/258k · 🧹 Compactions: 0
    - Verified /status did not include DeepSeek balance text.
    

    Retained renderer proof excerpt from the existing PR body:

    🦞 OpenClaw 2026.6.2 (da92615)
    ⏱️ Uptime: gateway 50s · system 9h 37m
    🧠 Configured default: deepseek/deepseek-v4-flash
    📌 Session selected: openai/gpt-5.5
    ⚠️ Reason: session override
    ⚠️ This session is pinned to openai/gpt-5.5; config primary deepseek/deepseek-v4-flash will apply to new/unpinned sessions.
    ↩️ Clear with: /model default
    📚 Context: ?/258k · 🧹 Compactions: 0
    🧵 Session: agent:main:main • updated just now
    ⚙️ Execution: direct · Runtime: OpenClaw Default · Think: off · Fast: off · Text: low · elevated
    🪢 Queue: steer (depth 0)
    
    CHECKS
    selectedOpenAI=true
    configuredDeepSeek=true
    deepSeekBalanceShown=false
    openAIContextShown=true
    
  • Observed result after fix: current-head after-fix proof shows Session selected: openai/gpt-5.5, keeps Configured default: deepseek/deepseek-v4-flash, resolves OpenAI context metadata as /258k, and verifies DeepSeek balance text is not shown for the OpenAI-selected session.

  • What was not tested: after-fix proof was not rerun in native Telegram Desktop; the original Telegram direct session report remains the before-fix evidence, and the current qa-channel run exercises the channel plugin boundary with a deterministic transcript and real gateway child.

  • Proof limitations or environment constraints: the new provider is mock-openai, so it proves routing and visible status selection without spending live provider quota. The retained renderer proof intentionally avoids a live external OpenAI balance request; regression tests separately assert the provider usage loader receives openai rather than deepseek, including when runtime state is stale.

  • Before evidence (optional but encouraged):

    OpenClaw 2026.6.6 (8c802aa)
    Channel: Telegram direct session
    Session: agent:main:main
    Session selected model: openai/gpt-5.5
    Configured default model: deepseek/deepseek-v4-flash
    
    🧠 Model: openai/gpt-5.5 · 🔑 api-key (models.json) (default: deepseek/deepseek-v4-flash)
    📊 Usage: Balance ¥22.75
    

    That Balance ¥22.75 was the DeepSeek provider balance while the same status card showed the session model as OpenAI.

Tests and validation

Which commands did you run?

  • daily_fix run-validation --name status-requested-focused-run-vitest -- node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts -t "uses the session-selected model provider for /status usage" — passed; 1 test passed.
  • daily_fix run-validation --name status-requested-run-vitest-suite -- node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts src/agents/openclaw-tools.session-status.test.ts — passed; 2 Vitest shards passed, 93 tests passed.
  • daily_fix run-validation --name check-test-types-round2 -- pnpm check:test-types — passed.
  • daily_fix run-validation --name qa-channel-model-status-proof-round2 -- pnpm exec tsx <qa-channel-model-status-proof.ts> — passed; drives /model openai/gpt-5.5 then /status through qa-channel and a real gateway child.
  • daily_fix run-validation --name ci-boundary-no-extension-test-core-imports -- pnpm run lint:plugins:no-extension-test-core-imports — passed after syncing current main; confirms the prior Feishu extension boundary blocker is no longer present on the updated branch.
  • daily_fix run-validation --name ci-core-support-boundary-isolated-tmp -- env TMPDIR=<isolated task temp> NODE_OPTIONS=--max-old-space-size=8192 OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.full-core-support-boundary.config.ts — passed; 12 test files and 97 tests passed.
  • daily_fix run-validation --name ci-core-tooling-test-projects -- env NODE_OPTIONS=--max-old-space-size=8192 OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.tooling.config.ts src/scripts/test-projects.test.ts --reporter=verbose — passed; 83 tests passed.
  • daily_fix run-validation --name focused-status-regression -- env NODE_OPTIONS=--max-old-space-size=8192 OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.auto-reply.config.ts src/auto-reply/reply/commands-status.test.ts --reporter=verbose — passed; 33 status regression tests passed, including selected-provider and stale-runtime cases.
  • daily_fix run-validation --name ci-core-tooling-cross-os-release-checks -- env NODE_OPTIONS=--max-old-space-size=8192 OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.tooling.config.ts test/scripts/openclaw-cross-os-release-checks.test.ts --reporter=verbose — passed; 95 process-cleanup and cross-OS release-check tests passed.
  • daily_fix run-validation --name legacy-fallback-usage-green-typesafe -- env NODE_OPTIONS=--max-old-space-size=8192 OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.auto-reply.config.ts src/auto-reply/reply/commands-status.test.ts -t "uses active fallback provider usage for legacy fallback notices" --reporter=verbose — passed; the legacy runtime-handoff notice case now keeps Fallback: minimax-portal/MiniMax-M2.7, uses the active MiniMax context window, and loads usage through minimax.
  • daily_fix run-validation --name check-test-types-after-fallback-fix -- pnpm check:test-types — passed after the legacy fallback-notice usage guard was added.
  • daily_fix run-validation --name focused-status-regression-after-fallback-fix-typesafe -- env NODE_OPTIONS=--max-old-space-size=8192 OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs run --config test/vitest/vitest.auto-reply.config.ts src/auto-reply/reply/commands-status.test.ts --reporter=verbose — passed; 34 status regression tests passed, including selected-provider, stale-runtime, and legacy fallback-notice usage routing cases.
  • daily_fix run-validation --name focused-status-regression-after-sync -- env NODE_OPTIONS=--max-old-space-size=8192 OPENCLAW_VITEST_MAX_WORKERS=2 pnpm exec node scripts/test-projects.mjs src/auto-reply/reply/commands-status.test.ts -- --reporter=verbose — passed after syncing current main; 1 auto-reply Vitest shard passed, 34 status regression tests passed.
  • daily_fix run-validation --name fallback-context-status-regression -- bash -lc 'OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts && OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/run-vitest.mjs src/status/status-text.test.ts src/status/status-message.test.ts src/auto-reply/status.test.ts' — passed; 35 status command tests, 2 status-text tests, 5 status-message tests, and 84 auto-reply status tests passed.

What regression coverage was added or updated?

Regression coverage was added in commands-status.test.ts for selected-provider usage/auth/context lookup so /status does not keep querying DeepSeek after the session is pinned to OpenAI. The scenarios lock in separate providerOverride: "openai" + modelOverride: "gpt-5.5", provider-qualified modelOverride: "openai/gpt-5.5", stale-runtime state where the selected session provider is OpenAI but sessionEntry.modelProvider/model still points at DeepSeek, legacy active fallback usage routing, and unresolved active fallback context routing where the live runtime window must win over a stale persisted selected-model window.

What failed before this fix, if known?

The PR-introduced typecheck blocker failed because the new OpenAI provider fixture did not satisfy the ModelProviderConfig contract: baseUrl is required. The original behavior regression was that a selected OpenAI session could still show DeepSeek usage/balance data in /status. The stale-runtime regression test also failed before the latest status routing fix because /status still rendered Usage: Balance ¥42.50 and queried deepseek when the selected session model was openai/gpt-5.5. The unresolved active fallback regression failed before the final context fix because /status rendered Context: 49k/1.0m from stale persisted selected-model state instead of the live runtime Context: 49k/123k snapshot.

If no test was added, why not?

Not applicable. Focused regression tests were added, and the smallest reliable guardrail is the status command test because it reaches the resolver, usage/auth/context lookup, and rendered status output without broadening provider or config behavior.

Risk checklist

Did user-visible behavior change? (Yes/No)

Yes. /status now reports and looks up session-selected model details for pinned sessions while still showing the configured default for unpinned/new-session context.

Did config, environment, or migration behavior change? (Yes/No)

No. The public config/default/compatibility contract is unchanged; the test fixture now includes the required OpenAI baseUrl, and no migration, default, or backward-compatibility behavior changed.

Did security, auth, secrets, network, or tool execution behavior change? (Yes/No)

Yes, narrowly in status lookup routing: auth and usage labels are resolved against the selected provider for a pinned session unless active runtime is authoritative through automatic handoff provenance or equivalent runtime alias. This does not add credentials, secrets, migrations, tools, or new network surfaces.

What is the highest-risk area?

Pinned-session status could query or display the wrong provider if selected/default/active model references are resolved incorrectly. The contract surface is provider routing for status metadata, not model execution or stored config schema.

How is that risk mitigated?

The root-cause boundary is covered by focused regression tests for both override shapes, stale runtime state, active fallback usage routing, and unresolved active fallback context routing. The retained renderer proof shows the selected OpenAI status output, and the current-head qa-channel proof shows the visible /model then /status transcript using the selected OpenAI model while the configured DeepSeek default remains visible. Patch quality warnings are addressed by keeping the diff scoped to resolver/status lookup and the required test fixture config, rather than adding downstream guards, compatibility branches, or renderer string filtering.

Current review state

What is the next action?

High confidence: ready for maintainer review after the updated branch and PR body are submitted.

What is still waiting on author, maintainer, CI, or external proof?

Author-side typecheck, stale-runtime usage, legacy runtime-handoff usage, unresolved fallback runtime context, ClawSweeper review, and proof items are addressed locally. The current-head CI failures investigated here are in unrelated test-infrastructure shards, not in the status files changed by this PR; remote checks need to rerun and settle on the updated branch. The native Telegram Desktop proof remains external-environment limited; the deterministic qa-channel proof and status regression suite cover the fixed /model then /status behavior.

Which bot or reviewer comments were addressed?

  • RF-001: current-head CI was investigated. The failing jobs point at unrelated test infrastructure paths (cli-runner.spawn.test.ts, test-projects.test.ts, bench-gateway-restart.test.ts, and resolve-openclaw-ref.test.ts), while the synced status regression suite passed on this branch.
  • RF-002: disclosed the overlap with fix: /status usage follows session /model override instead of stale runtime provider #93829 in the reviewer-focus section so maintainers can choose one canonical resolver path.
  • RF-003: /status no longer shows or queries stale DeepSeek usage when a user-selected session retains old runtime model fields; the regression asserts providers: ["openai"] and rejects Usage: Balance ¥42.50.
  • RF-004: disclosed the overlapping open fix candidate risk and kept this PR scoped to the existing status routing implementation rather than creating or bypassing a competing canonical path.
  • RF-005: kept the repair narrow: one status usage-provider selection change plus a focused stale-runtime regression, without deciding new product direction.
  • RF-006: src/status/status-text.ts now uses selected usage when runtime state is stale, while preserving active-provider usage for automatic handoff provenance, existing active runtime-handoff notices, and equivalent runtime aliases.
  • ClawSweeper runtime-handoff usage finding: added a focused legacy notice regression and routed /status usage through the active provider when the stored notice still matches the selected and active model refs. This is a root-cause source-of-truth boundary fix: it reuses the existing active runtime-handoff state to distinguish intentional active runtime from stale manual override state, instead of masking rendered text or adding a new compatibility fallback.
  • ClawSweeper fallback context finding: added an unresolved active fallback regression and now passes the live runtime context snapshot through when an active fallback notice is present but the fallback model cannot be resolved from config, so /status shows Context: 49k/123k instead of stale Context: 49k/1.0m.
  • RF-007: ran node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts -t "uses the session-selected model provider for /status usage"; passed.
  • RF-008: ran node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts; covered by the requested status suite command and passed.
  • RF-009: ran node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts src/agents/openclaw-tools.session-status.test.ts; passed.
  • Local commit review: daily_fix clawsweeper-commit-review passed on the submitted head.

@openclaw-barnacle openclaw-barnacle Bot added size: M proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 10:42 AM ET / 14:42 UTC.

Summary
The PR changes /status and session_status model resolution so usage, auth, harness, and context lookup follow the session-selected model after /model, while preserving explicit fallback/runtime-alias cases and adding focused regression tests.

PR surface: Source +39, Tests +384. Total +423 across 4 files.

Reproducibility: yes. Source-level reproduction is high-confidence: current main can receive selected OpenAI overrides plus stale DeepSeek runtime fields, and the status usage provider currently follows active runtime state; I did not run tests or live Telegram in this read-only review.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #93322
Summary: This PR is the live focused fix candidate for the canonical /status usage-provider mismatch after a session /model switch; broader resolver work is related but distinct.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Mantis proof suggestion
Native Telegram Desktop proof would materially confirm the originally reported visible status transcript. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify `/model openai/gpt-5.5` then `/status` shows OpenAI session metadata and does not show DeepSeek balance.

Risk before merge

  • [P2] The PR changes which provider/auth surface /status probes use for pinned sessions, so maintainers should explicitly accept that selected session overrides win unless fallback/runtime-alias provenance says the active runtime is authoritative.
  • [P1] The PR changes selected-versus-active runtime interpretation for visible status metadata; a bad merge in this area can show stale or mismatched session state even when model execution itself is unchanged.
  • [P1] Native Telegram Desktop proof was not rerun for the exact reported transport, although the PR body includes qa-channel plus real gateway-child live output and renderer proof.

Maintainer options:

  1. Accept the focused status routing change
    Maintainers can land this after accepting that /status usage/auth/context should follow the selected session model unless fallback or runtime-alias provenance makes the active runtime authoritative.
  2. Hold for the broader resolver
    Maintainers can pause this PR if they want all selected/runtime/auth/status semantics centralized under the broader session resolver before changing the status path.

Next step before merge

  • [P2] Maintainers should review and accept the auth-provider/session-state routing risk; no narrow automated repair is indicated from this pass.

Security
Cleared: The diff only changes status resolver logic and tests; no new dependency, workflow, secret, install, or code-execution surface was found.

Review details

Best possible solution:

Land this or an equivalent focused status routing fix for #93322, and leave the broader shared resolver work in #87957 open for maintainer sequencing.

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

Yes. Source-level reproduction is high-confidence: current main can receive selected OpenAI overrides plus stale DeepSeek runtime fields, and the status usage provider currently follows active runtime state; I did not run tests or live Telegram in this read-only review.

Is this the best way to solve the issue?

Yes for the narrow bug. The PR moves the status lookup boundary to the selected session model and keeps active-runtime behavior only for explicit fallback/runtime-alias provenance; the broader resolver issue remains the safer place for cross-surface cleanup.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority status correctness bug with limited blast radius, not a core runtime outage.
  • merge-risk: 🚨 auth-provider: The diff changes which provider and auth surface /status uses for usage and auth metadata after a session-level model override.
  • merge-risk: 🚨 session-state: The diff changes how selected versus active runtime session state controls visible status metadata and context routing.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix live output from a qa-channel flow with a real gateway child plus renderer output showing /model openai/gpt-5.5 then /status no longer emits DeepSeek balance.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix live output from a qa-channel flow with a real gateway child plus renderer output showing /model openai/gpt-5.5 then /status no longer emits DeepSeek balance.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The changed /model then /status chat transcript is user-visible in Telegram and can be demonstrated in a short Telegram Desktop recording.
Evidence reviewed

PR surface:

Source +39, Tests +384. Total +423 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 57 18 +39
Tests 1 384 0 +384
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 441 18 +423

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts.
  • [P1] node scripts/run-vitest.mjs src/status/status-text.test.ts src/status/status-message.test.ts src/auto-reply/status.test.ts.
  • [P1] pnpm check:test-types.

What I checked:

  • Repository policy applied: Root policy was read fully; it treats auth/session state, provider routing, fallback behavior, and status surfaces as compatibility-sensitive review areas. (AGENTS.md:1, d83cd282c602)
  • Scoped policy search: No scoped AGENTS.md owns the touched src/status or src/auto-reply paths; the Telegram maintainer note was also read because the PR has a Telegram-visible proof label.
  • Current main bug source: On current main, buildStatusText resolves currentUsageProvider from activeStatusProvider or activeProvider, so stale active runtime provider fields can still drive the usage line. (src/status/status-text.ts:445, d83cd282c602)
  • Current active runtime source: resolveSelectedAndActiveModel uses persisted sessionEntry.modelProvider/model as the active runtime ref when present, matching the stale-runtime condition in the linked bug report. (src/auto-reply/model-runtime.ts:90, d83cd282c602)
  • PR head status routing fix: The PR computes selected lookup provider/model from session overrides, then only follows active runtime usage when active runtime is authoritative by fallback, auto-fallback provenance, or runtime alias equivalence. (src/status/status-text.ts:356, 3a98a2844c54)
  • PR head renderer alignment: The PR updates buildStatusMessage to parse provider-qualified selected overrides and use the selected lookup provider/model for auth, context, and channel model notes. (src/status/status-message.ts:596, 3a98a2844c54)

Likely related people:

What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Jun 19, 2026
@zhangguiping-xydt
zhangguiping-xydt marked this pull request as draft June 20, 2026 12:41
@zhangguiping-xydt
zhangguiping-xydt marked this pull request as ready for review June 20, 2026 13:07
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. 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. and removed 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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 20, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. and removed 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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels Jun 21, 2026
@xuwei-xy

Copy link
Copy Markdown

A potential solution is to modify api. What do you think?

@zhangguiping-xydt zhangguiping-xydt changed the title [Bug]: /status usage should follow session-selected model after /model switch fix(status): usage follows session model after switch Jun 22, 2026
@zhangguiping-xydt
zhangguiping-xydt force-pushed the fix/issue-93322 branch 4 times, most recently from 936dcb8 to 3a98a28 Compare June 24, 2026 14:31
@zhangguiping-xydt

zhangguiping-xydt commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@obviyus quick clarification after the rebase/squash:

#95797 focused on the pinned-session /status display wording. This PR covers a different path: after a session model switch, /status usage/auth/context lookup could still follow the stale/default provider instead of the session-selected model.

I updated the tests to match the new #95797 display wording, and the behavior fix here appears to still be needed.

@obviyus obviyus self-assigned this Jun 25, 2026
@obviyus
obviyus merged commit 29670c1 into openclaw:main Jun 25, 2026
94 checks passed
@obviyus

obviyus commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Landed via rebase onto main.

  • Scoped tests: OPENCLAW_LOCAL_CHECK_MODE=throttled node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts src/status/status-text.test.ts src/status/status-message.test.ts src/auto-reply/status.test.ts
  • Changelog: skipped; release generation owns CHANGELOG.md for normal PRs
  • Land commit: 680334f
  • Merge commit: 29670c1

Thanks @zhangguiping-xydt!

@zhangguiping-xydt

Copy link
Copy Markdown
Contributor Author

@obviyus Thank you! You're amazing. 😄 Really appreciate you taking the time to review and land this. It makes contributing to OpenClaw a great experience~

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

Labels

mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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]: /status usage should follow session-selected model after /model switch

3 participants