Skip to content

fix: show effective channel model in Telegram status - #118548

Merged
steipete merged 1 commit into
mainfrom
codex/fix-89532-native-status-effective-model
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-89532-native-status-effective-model

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #89532

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Fixes an issue where users running the native /status command in a Telegram group, topic, or direct conversation would see the account's default model and its associated runtime settings instead of the effective model configured for that conversation through channels.modelByChannel.

Before the fix, a Telegram conversation configured for anthropic/claude-sonnet-4-6 could report the default openai/gpt-5.6-luna and stale runtime, thinking, fast-mode, or context information.

Why This Change Was Made

Native Telegram /status returns before the ordinary reply pipeline reaches channel-model routing. Resolve the effective channel model once at the native status producer, before model-bound thinking, authentication, runtime, context, and fast-mode facts are prepared, using the existing canonical channel-override and model-alias resolvers.

Preserve explicit session selections, valid automatic fallbacks, model-selection locks, and already-prepared heartbeat/fallback models. Support Telegram topics, model-parent sessions, direct peer/sender IDs, aliases, and current-channel identity; ignore persisted direct-message origin data from another channel so a shared session cannot apply a stale Discord identity to a Telegram command.

This supersedes the larger renderer-layer approach in #117443 without modifying or closing that bot PR.

Scope is intentionally the Telegram/native status path reported in #89532. Discord's separate direct status path through extensions/discord/src/monitor/native-command-status.ts and src/plugin-sdk/command-status.runtime.ts remains an explicit follow-up; this PR does not expand or change the public plugin SDK contract.

User Impact

Telegram users can trust /status to show the actual model selected for their configured group, topic, or direct conversation, along with that model's correct runtime, context window, thinking level, and fast-mode state. Existing explicit model choices, locked sessions, and heartbeat/fallback selections remain unchanged.

Evidence

  • Full existing and new focused native-command suites: 61/61 tests passed.

    node scripts/run-vitest.mjs \
      src/auto-reply/reply/get-reply-native-slash-fast-path.status.test.ts \
      src/auto-reply/reply/get-reply-native-slash-fast-path.test.ts
    
    Test Files  2 passed (2)
         Tests  61 passed (61)
    
  • Dedicated Linux/Testbox regression matrix: 12/12 tests passed, covering effective channel selection, aliases, stale shared-session channel metadata, group/topic parent fallback, explicit model-parent sessions, direct native peer IDs, live sender IDs, conflicting stale cross-channel direct-message identities, explicit user/automatic selections, locked sessions, and prepared heartbeat/fallback models. Routed-model thinking defaults are asserted on the real producer callback.

  • Full remote changed-file gate: passed, including production and test tsgo checks, formatting, lint, max-lines ratchets, plugin boundaries, SDK surface baseline, dependency guards, dead-code checks, import cycles, database/schema guards, and the remaining repository safeguards.

    pnpm check:changed
    provider=blacksmith-testbox
    leaseId=tbx_01kz3079cv7jxpavh29yttr9e5
    exitCode=0
    runStatus=succeeded
    

    Testbox workflow: https://github.com/openclaw/openclaw/actions/runs/30786178929

    The delegated one-shot runner was stopped after successful proof; the backing Actions step can show cancellation during normal lease cleanup. The wrapper's exitCode=0 and runStatus=succeeded are the authoritative result.

  • Real isolated production getReplyFromConfig native Telegram /status invocation, with an actual persisted session, exact group-specific channels.modelByChannel configuration, and the real status formatter:

    🧠 Model: anthropic/claude-sonnet-4-6 · channel override
    📚 Context: ?/1.0m · 🧹 Compactions: 0
    ⚙️ Execution: direct · Runtime: OpenClaw Default · Think: high · Fast: on
    
  • Fresh Codex Sol extra-high-reasoning autoreview: clean; no accepted/actionable findings.

  • Four independent owner-boundary reviews: GO; no actionable P0/P1/P2 findings.

  • AI-assisted implementation; the behavior, ownership boundary, and validation evidence were independently reviewed.

Maintainer review decisions

  • Scope: land the producer-owned Telegram native /status repair reported in Bug: /status does not show effective model from channels.modelByChannel #89532. Discord's independent direct-status producer remains a separate, explicitly documented follow-up; expanding this PR into the plugin SDK would cross its owner boundary.
  • Current-main compatibility: current main 0cad02313a9cbc6d1e60dfcb1d44b1bde523e3fb produces a clean merge tree with this reviewed head, and neither of the two touched files changed on main since the branch point. Behind-main drift alone does not justify replacing the exact head that already has successful hosted CI.
  • User-visible proof: the production native Telegram getReplyFromConfig + persisted SQLite scenario directly displays the effective model and its matching runtime/context/thinking/fast facts; an additional Mantis recording would be supplemental, not a missing correctness gate.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 3, 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. P2 Normal backlog priority with limited blast radius. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 4:32 AM ET / 08:32 UTC.

ClawSweeper review

What this changes

The branch makes native Telegram /status resolve the effective channels.modelByChannel model before it renders model, runtime, context, thinking, and fast-mode details.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This PR remains necessary and is a focused candidate fix for the Telegram /status mismatch in #89532. Current main still passes the default/session model straight into the native status builder before normal channel-model routing, while this branch resolves the applicable channel override at that producer boundary; the supplied real invocation and focused regression proof support a maintainer merge review. Likely related people: steipete (high confidence) and joshavant (medium confidence).

Priority: P2
Reviewed head: c2e2b5647f99df9f201af52f731d84753e43ce82

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has strong targeted real-behavior evidence and a focused owner-boundary implementation; only the normal exact-merge-result validation remains before landing.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body contains an after-fix persisted-session native Telegram status invocation using the real formatter and a configured channel override, visibly showing the effective model plus matching context, runtime, thinking, and fast-mode facts.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body contains an after-fix persisted-session native Telegram status invocation using the real formatter and a configured channel override, visibly showing the effective model plus matching context, runtime, thinking, and fast-mode facts.
Evidence reviewed 6 items Current-main behavior: Current main passes params.provider and params.model directly into the native /status builder after loading session and catalog facts; it does not resolve channels.modelByChannel in that producer path.
Proposed producer-boundary repair: The PR resolves a channel override only when no explicit or locked session model owns selection, converts aliases through the canonical resolver, and uses the resulting provider/model for thinking and status construction.
Shared override contract: The canonical resolver already owns direct-chat, parent-session, topic/group, and wildcard lookup precedence, so the PR reuses existing routing policy rather than adding a Telegram-specific parser.
Findings None None.
Security None None.

How this fits together

Telegram native slash commands enter OpenClaw’s reply fast path, which creates a status response before the ordinary reply pipeline runs. The response consumes session and delivery metadata, then becomes the status message shown to the Telegram operator.

flowchart LR
  A[Telegram slash command] --> B[Native reply fast path]
  B --> C[Session and delivery facts]
  C --> D[Channel model selection]
  D --> E[Status detail builder]
  E --> F[Telegram status message]
Loading

Before merge

  • Resolve merge risk (P2) - Merging changes precedence among explicit session selections, locks, prepared fallback models, and channel overrides; retain the focused regression cases for each precedence branch when validating the exact merge result.
  • Resolve merge risk (P1) - The PR head is behind current main; although the supplied context says GitHub has a clean merge result, recheck the exact merge commit and focused native-status proof before landing.
  • Complete next step (P2) - The PR is maintainer-labeled and its remaining action is exact-head merge-gate verification, not an automated replacement repair.
Agent review details

Security

None.

PR surface

Source +54, Tests +293. Total +347 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 59 5 +54
Tests 1 293 0 +293
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 352 5 +347

Review metrics

Metric Value Why it matters
Production versus regression coverage production +59/-5; tests +293 The production precedence change is paired with a dedicated status regression matrix, which is important because this path combines persisted session state and channel routing.

Mantis proof suggestion

A short native Telegram Desktop capture would provide maintainers an additional direct visual check of the configured group or topic model shown by /status. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify and capture `/status` in a configured Telegram group or topic showing the effective channel model override.

Merge-risk options

Maintainer options:

  1. Verify the current merge result (recommended)
    Refresh or verify the merge result against current main, then retain the focused Telegram native-status regression proof before landing.
  2. Pause for a shared cross-channel status contract
    Pause this PR only if maintainers want Telegram and Discord direct-status producers to move together behind a deliberately reviewed shared contract.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Verify the current merge result against main and rerun the focused native Telegram status regression proof.

Technical review

Best possible solution:

Land the producer-owned native-status repair with its persisted-session regression coverage, then handle Discord’s independent direct-status producer in a separate owner-boundary change if that surface still shows the same inconsistency.

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

Yes. Current source shows native /status passes the default/session model directly to the status builder, and the supplied persisted-session Telegram scenario demonstrates the corrected channel-override result.

Is this the best way to solve the issue?

Yes. Resolving the canonical channel override at the native producer is the narrowest maintainable fix because this fast path builds all model-dependent status facts before ordinary reply routing runs.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: The defect makes Telegram /status misreport an active model route and can mislead operators, but it does not interrupt message delivery or runtime availability.
  • merge-risk: 🚨 compatibility: The patch intentionally changes how existing session selections, locks, fallback models, and channels.modelByChannel interact in native status output.
  • 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 contains an after-fix persisted-session native Telegram status invocation using the real formatter and a configured channel override, visibly showing the effective model plus matching context, runtime, thinking, and fast-mode facts.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains an after-fix persisted-session native Telegram status invocation using the real formatter and a configured channel override, visibly showing the effective model plus matching context, runtime, thinking, and fast-mode facts.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The patch changes the model and runtime details directly displayed by Telegram’s /status response.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current focused candidate fix after identifying the native status producer as the missing channel-routing boundary. (role: feature owner and recent area contributor; confidence: high; commits: c2e2b5647f99; files: src/auto-reply/reply/get-reply-native-slash-fast-path.ts, src/auto-reply/reply/get-reply-native-slash-fast-path.status.test.ts)
  • joshavant: Most recent available current-main history/blame for the fast-path surface is the session-boundary test refactor, making this a useful adjacent review route. (role: recent adjacent contributor; confidence: medium; commits: d6f964513f14; files: src/auto-reply/reply/get-reply-native-slash-fast-path.ts, src/auto-reply/reply/get-reply-native-slash-fast-path.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Verify the exact current merge result and preserve the focused native Telegram status regression proof.

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-08-03T07:26:59.996Z sha c2e2b56 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 3, 2026
@steipete
steipete merged commit b21056a into main Aug 3, 2026
139 of 148 checks passed
@steipete
steipete deleted the codex/fix-89532-native-status-effective-model branch August 3, 2026 08:45
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
…ion-routing

* origin/main:
  refactor(agents): remove stale runner state plumbing (#118495)
  test(gateway): skip servers for handler fixtures (#118581)
  test(tui): reuse real gateway PTY fixture (#118567)
  fix: keep command tests independent of ambient Gateway tokens (#118577)
  fix: show effective channel model in Telegram status (#118548)
  test(system-agent): reuse approval CLI fixture (#118572)
  test(macos): deduplicate Claude session catalog fixtures (#118571)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 does not show effective model from channels.modelByChannel

1 participant