openclaw - 💡(How to fix) Fix Expose actual dispatched model to agent session context [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60724Fetched 2026-04-08 02:47:58
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
1

Root Cause

Kennet is configured with anthropic/claude-opus-4-6 primary and openai/gpt-5.4 as first fallback. When Anthropic credits are exhausted, the gateway correctly falls back to GPT-5.4, but Kennet reports "model: Opus" in his status messages because that's what config says.

Fix Action

Fix / Workaround

Expose the resolved/dispatched model to the agent via session metadata — something like session.model.resolved or equivalent. This would allow agents to:

Code Example

[model-fallback/decision] decision=skip_candidate requested=anthropic/claude-opus-4-6 candidate=anthropic/claude-opus-4-6 reason=billing next=openai/gpt-5.4
[model-fallback/decision] decision=candidate_succeeded requested=anthropic/claude-opus-4-6 candidate=openai/gpt-5.4
RAW_BUFFERClick to expand / collapse

Problem

When the gateway performs a model fallback (e.g. billing exhaustion, rate limiting, overload), the agent has no way to know which model actually served the request. Agents that self-report their model (e.g. in status updates to users) read from config (model.primary) and report the configured model, not the actual model.

This is misleading — the agent genuinely believes it's running on one model when it's running on another.

Example

Kennet is configured with anthropic/claude-opus-4-6 primary and openai/gpt-5.4 as first fallback. When Anthropic credits are exhausted, the gateway correctly falls back to GPT-5.4, but Kennet reports "model: Opus" in his status messages because that's what config says.

Gateway logs show the fallback working correctly:

[model-fallback/decision] decision=skip_candidate requested=anthropic/claude-opus-4-6 candidate=anthropic/claude-opus-4-6 reason=billing next=openai/gpt-5.4
[model-fallback/decision] decision=candidate_succeeded requested=anthropic/claude-opus-4-6 candidate=openai/gpt-5.4

But the agent has no access to this information.

Proposed Solution

Expose the resolved/dispatched model to the agent via session metadata — something like session.model.resolved or equivalent. This would allow agents to:

  1. Accurately self-report which model they're running on
  2. Adjust behaviour if needed (e.g. skip tasks that require a specific model's capabilities)
  3. Inform users when they're on a fallback model

Impact

Without this, users receive inaccurate model reports from agents during fallback scenarios, which erodes trust — especially when output quality visibly differs from the expected model.

extent analysis

TL;DR

Expose the resolved model to the agent via session metadata to accurately report the model being used.

Guidance

  • Modify the gateway to include the resolved model in session metadata, such as session.model.resolved, to allow agents to access this information.
  • Update agents to read the resolved model from session metadata instead of relying on the configured model (model.primary) for self-reporting.
  • Consider adding logic for agents to adjust their behavior based on the resolved model, such as skipping tasks that require specific model capabilities.
  • Inform users when they are being served by a fallback model to maintain transparency and trust.

Example

# Example of how an agent might access the resolved model
resolved_model = session.metadata.get('model.resolved')
if resolved_model:
    # Report the resolved model in status updates
    print(f"Model: {resolved_model}")

Notes

The proposed solution assumes that the gateway can reliably determine the resolved model during fallback scenarios and that session metadata is accessible to agents.

Recommendation

Apply the proposed solution of exposing the resolved model via session metadata to ensure accurate model reporting and maintain user trust.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING