openclaw - 💡(How to fix) Fix Model Aliases in system prompt cause LLM to substitute providers unexpectedly [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#61949Fetched 2026-04-08 03:10:51
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

When multiple providers are configured for equivalent models (e.g., github-copilot/claude-sonnet-4.6 and amazon-bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0), the Model Aliases section injected into the system prompt causes the LLM to treat them as interchangeable. This leads to unexpected provider substitution.

Root Cause

The "Model Aliases" section in the system prompt teaches the LLM that different provider paths are interchangeable:

Prefer aliases when specifying model overrides; full provider/model is also accepted.

This invites the LLM to "helpfully" translate a specific provider/model request to whatever alias it recognizes, even when an explicit provider is specified.

Fix Action

Workaround

We're removing Bedrock from our config entirely to prevent this. The aliases will no longer be injected, and the LLM won't have alternative providers to choose from.

Code Example

## Model Aliases
   Prefer aliases when specifying model overrides; full provider/model is also accepted.
   - Bedrock Sonnet 4: amazon-bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0
   ...

---

Prefer aliases when specifying model overrides; full provider/model is also accepted.

---

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "github-copilot/claude-opus-4.5",
        "fallbacks": ["amazon-bedrock/us.anthropic.claude-opus-4-5-20251101-v1:0"]
      },
      "models": {
        "amazon-bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0": {"alias": "Bedrock Sonnet 4"},
        ...
      }
    }
  },
  "models": {
    "providers": {
      "amazon-bedrock": { ... },
      "github-copilot": { ... }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw version: 2026.3.28 (f9b1079)
  • OS: macOS 15.7.2 (arm64)
  • Note: We have not tested on 2026.4.x versions due to disruptive changes in tool call permissions/UX.

Summary

When multiple providers are configured for equivalent models (e.g., github-copilot/claude-sonnet-4.6 and amazon-bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0), the Model Aliases section injected into the system prompt causes the LLM to treat them as interchangeable. This leads to unexpected provider substitution.

Observed Behavior

  1. Dispatcher requests sub-agent with explicit model: github-copilot/claude-sonnet-4.6
  2. The LLM (Opus) receives this in a prompt: Model: "github-copilot/claude-sonnet-4.6"
  3. The LLM sees the Model Aliases in its system prompt:
    ## Model Aliases
    Prefer aliases when specifying model overrides; full provider/model is also accepted.
    - Bedrock Sonnet 4: amazon-bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0
    ...
  4. The LLM interprets "Sonnet 4" as equivalent across providers
  5. When calling sessions_spawn, it substitutes amazon-bedrock/... instead of passing through the requested github-copilot/...

Why This Is a Problem

Different providers for the "same" model are not equivalent:

  • Different API behaviors: Bedrock's Converse API has strict thinking block requirements that GitHub Copilot doesn't
  • Different auth mechanisms: One uses OAuth/token, the other uses AWS SDK
  • Different cost structures: Bedrock is significantly more expensive
  • Different rate limits and availability

In our case, sub-agents were crashing immediately because Bedrock Sonnet 4 with thinking enabled requires assistant messages to start with thinking blocks — a constraint the LLM violated after receiving tool results. The crash happened silently with no advance/retreat, causing infinite dispatch loops.

Root Cause

The "Model Aliases" section in the system prompt teaches the LLM that different provider paths are interchangeable:

Prefer aliases when specifying model overrides; full provider/model is also accepted.

This invites the LLM to "helpfully" translate a specific provider/model request to whatever alias it recognizes, even when an explicit provider is specified.

Suggested Fix

Options (not mutually exclusive):

  1. Don't inject aliases for multi-provider overlaps — if two providers offer the same underlying model, don't suggest they're equivalent
  2. Change alias guidance — instead of "prefer aliases," say "use the exact provider/model string when one is specified"
  3. Separate aliases from provider routing — aliases should be for user convenience ("use sonnet"), not for LLM decision-making about provider selection
  4. Make provider explicit — when a full provider/model string is given, the LLM should pass it through verbatim, not interpret it

Workaround

We're removing Bedrock from our config entirely to prevent this. The aliases will no longer be injected, and the LLM won't have alternative providers to choose from.

Config That Triggered This

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "github-copilot/claude-opus-4.5",
        "fallbacks": ["amazon-bedrock/us.anthropic.claude-opus-4-5-20251101-v1:0"]
      },
      "models": {
        "amazon-bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0": {"alias": "Bedrock Sonnet 4"},
        ...
      }
    }
  },
  "models": {
    "providers": {
      "amazon-bedrock": { ... },
      "github-copilot": { ... }
    }
  }
}

extent analysis

TL;DR

The most likely fix is to modify the "Model Aliases" section in the system prompt to prevent the LLM from treating different providers as interchangeable when an explicit provider is specified.

Guidance

  • Review the "Model Aliases" section in the system prompt and consider removing or modifying it to avoid suggesting that different providers are equivalent.
  • Update the alias guidance to instruct the LLM to use the exact provider/model string when one is specified, rather than preferring aliases.
  • Consider separating aliases from provider routing to prevent the LLM from making decisions about provider selection based on aliases.
  • Verify that the LLM passes through the full provider/model string verbatim when it is given, without interpreting it or substituting alternative providers.

Example

No code snippet is provided as the issue is related to configuration and system prompt modifications.

Notes

The suggested fix may require modifications to the OpenClaw configuration and system prompt. It is essential to test these changes thoroughly to ensure they resolve the issue without introducing new problems.

Recommendation

Apply a workaround by modifying the "Model Aliases" section in the system prompt to prevent the LLM from treating different providers as interchangeable. This change can help prevent unexpected provider substitution and ensure that the LLM uses the intended provider when an explicit provider is specified.

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