openclaw - ✅(Solved) Fix [Bug]: Model ID with version suffix (@YYYYMMDD) is truncated by splitTrailingAuthProfile [3 pull requests, 2 comments, 3 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#48854Fetched 2026-04-08 00:51:53
View on GitHub
Comments
2
Participants
3
Timeline
14
Reactions
0
Author
Timeline (top)
cross-referenced ×6referenced ×4commented ×2closed ×1

When a custom provider model ID contains a version suffix using @ (e.g. vertex-ai_claude-haiku-4-5@20251001), OpenClaw silently truncates everything after @, causing the request to fail with a model-not-found error.

Error Message

When a custom provider model ID contains a version suffix using @ (e.g. vertex-ai_claude-haiku-4-5@20251001), OpenClaw silently truncates everything after @, causing the request to fail with a model-not-found error.

Root Cause

splitTrailingAuthProfile does not distinguish between:

  • model-id@auth-profile (intentional profile syntax)
  • model-id@20251001 (version suffix used by LiteLLM / Vertex AI model naming conventions)

Fix Action

Workaround

Add a no-@ alias for the model in LiteLLM config and use that alias in OpenClaw.

PR fix notes

PR #48861: fix(model-ref): preserve version suffixes in model IDs

Description (problem / solution / changelog)

Summary

Model IDs containing version suffixes like @20251001 or @v1.2.3 were being incorrectly split by splitTrailingAuthProfile(), treating the version as an auth profile. This caused providers like LiteLLM/Vertex AI to receive truncated model IDs.

Problem

When a user configures a model like vertex-ai_claude-haiku-4-5@20251001, OpenClaw incorrectly splits it into:

  • model: vertex-ai_claude-haiku-4-5
  • profile: 20251001

The version suffix is stripped, causing a model-not-found error.

Solution

Added version suffix detection to splitTrailingAuthProfile(). The function now recognizes:

  • Numeric dates: @20251001
  • Semver patterns: @v1.2.3, @1.0.0-beta.1
  • Build numbers: @1234

These are preserved as part of the model ID rather than being extracted as auth profiles.

Tests

Added 8 new test cases covering:

  • Numeric version suffixes (date format)
  • Custom provider models with version suffixes
  • Semver-like version suffixes
  • Semver with prerelease tags
  • Verification that non-version profiles still work

Fixes #48854

Changed files

  • src/agents/model-ref-profile.test.ts (modified, +44/-0)
  • src/agents/model-ref-profile.ts (modified, +22/-0)

PR #48871: fix(model): keep @version suffixes in custom model ids

Description (problem / solution / changelog)

Summary

Keep custom model IDs intact when they use a pure numeric @version suffix (for example @20251001) so OpenClaw does not misinterpret the suffix as an auth-profile override.

Change Type

  • Bug fix

Scope

  • Model reference parsing for /model and related model-selection paths
  • Regression coverage for versioned custom provider model IDs

User-visible / Behavior Changes

  • Versioned custom model IDs like custom-litellm/vertex-ai_claude-haiku-4-5@20251001 now stay intact instead of being truncated before provider dispatch.
  • Existing auth-profile overrides like @work and email-based profile refs still parse as before.

Test plan

  • pnpm exec vitest run src/agents/model-ref-profile.test.ts

Closes #48854

Changed files

  • src/agents/model-ref-profile.test.ts (modified, +6/-0)
  • src/agents/model-ref-profile.ts (modified, +6/-0)

PR #48872: fix: preserve version suffix in model IDs (@YYYYMMDD)

Description (problem / solution / changelog)

Summary

The splitTrailingAuthProfile function was treating @20251001 as an auth profile delimiter, causing model IDs like vertex-ai_claude-haiku-4-5@20251001 to be incorrectly split into model vertex-ai_claude-haiku-4-5 and profile 20251001.

Problem

When a custom provider model ID contains a version suffix using @ (e.g. vertex-ai_claude-haiku-4-5@20251001), OpenClaw silently truncates everything after @, causing the request to fail with a model-not-found error.

Fix

Added check to not split if the part after @ looks like a date (8 digits like YYYYMMDD). This distinguishes version suffixes (e.g., @20251001) from auth profiles.

// Dont split if the part after @ looks like a version suffix (8 digits like YYYYMMDD)
if (/^\d{8}$/.test(potentialProfile)) {
  return { model: trimmed };
}

Fixes #48854

Changed files

  • extensions/voice-call/src/webhook.test.ts (modified, +14/-0)
  • extensions/voice-call/src/webhook.ts (modified, +19/-2)
  • src/agents/model-ref-profile.ts (modified, +8/-1)
  • src/agents/session-transcript-repair.ts (modified, +6/-1)
  • src/cron/service/timer.ts (modified, +2/-1)
  • src/poll-params.ts (modified, +2/-2)
  • src/shared/text/reasoning-tags.ts (modified, +2/-2)

Code Example

{
  "models": {
    "providers": {
      "my-litellm": {
        "models": [
          { "id": "vertex-ai_claude-haiku-4-5@20251001" }
        ]
      }
    }
  }
}

---

"custom-litellm/vertex-ai_claude-haiku-4-5@20251001": {}

---

const profileDelimiter = trimmed.indexOf("@", lastSlash + 1);
RAW_BUFFERClick to expand / collapse

Summary

When a custom provider model ID contains a version suffix using @ (e.g. vertex-ai_claude-haiku-4-5@20251001), OpenClaw silently truncates everything after @, causing the request to fail with a model-not-found error.

OpenClaw Version

2026.3.13 (61d171a)

Steps to Reproduce

  1. Configure a custom provider with a model ID containing @version, e.g.:
{
  "models": {
    "providers": {
      "my-litellm": {
        "models": [
          { "id": "vertex-ai_claude-haiku-4-5@20251001" }
        ]
      }
    }
  }
}
  1. Also add it to agents.defaults.models:
"custom-litellm/vertex-ai_claude-haiku-4-5@20251001": {}
  1. Try to switch to this model via /model or any session model switch.

Expected Behavior

The full model ID vertex-ai_claude-haiku-4-5@20251001 is passed to the provider as-is.

Actual Behavior

The splitTrailingAuthProfile function in src/agents/model-ref-profile.ts treats @ as an auth-profile delimiter:

const profileDelimiter = trimmed.indexOf("@", lastSlash + 1);

This causes vertex-ai_claude-haiku-4-5@20251001 to be split into:

  • model: vertex-ai_claude-haiku-4-5
  • profile: 20251001

The version suffix is stripped, and the provider receives an invalid/unknown model ID.

Root Cause

splitTrailingAuthProfile does not distinguish between:

  • model-id@auth-profile (intentional profile syntax)
  • model-id@20251001 (version suffix used by LiteLLM / Vertex AI model naming conventions)

Suggested Fix

Consider one of:

  1. Require an explicit prefix for auth profiles (e.g. @profile:name) to avoid ambiguity with version suffixes.
  2. Only treat @ as a profile delimiter when the suffix matches a known profile name from config.
  3. Add an escape mechanism or a dedicated version-suffix field in model config.

Workaround

Add a no-@ alias for the model in LiteLLM config and use that alias in OpenClaw.

extent analysis

Fix Plan

To fix the issue, we will implement the suggested fix of requiring an explicit prefix for auth profiles. We will modify the splitTrailingAuthProfile function to only treat @ as a profile delimiter when the suffix matches a known profile name from the config or when an explicit prefix is used.

Code Changes

We will update the src/agents/model-ref-profile.ts file with the following changes:

// Add a constant for the auth profile prefix
const AUTH_PROFILE_PREFIX = '@profile:';

// Update the splitTrailingAuthProfile function
function splitTrailingAuthProfile(trimmed) {
  const lastSlash = trimmed.lastIndexOf('/');
  const profileDelimiter = trimmed.indexOf(AUTH_PROFILE_PREFIX, lastSlash + 1);
  if (profileDelimiter !== -1) {
    // Split the model ID and profile
    const model = trimmed.substring(0, profileDelimiter);
    const profile = trimmed.substring(profileDelimiter + AUTH_PROFILE_PREFIX.length);
    return { model, profile };
  } else {
    // No auth profile, return the full model ID
    return { model: trimmed, profile: '' };
  }
}

Configuration Changes

We will update the model configuration to use the explicit prefix for auth profiles. For example:

{
  "models": {
    "providers": {
      "my-litellm": {
        "models": [
          { "id": "vertex-ai_claude-haiku-4-5@20251001" }
        ]
      }
    }
  }
}

No changes are needed in the above config, but when using auth profiles, the prefix should be used:

{
  "models": {
    "providers": {
      "my-litellm": {
        "models": [
          { "id": "vertex-ai_claude-haiku-4-5@profile:my-profile" }
        ]
      }
    }
  }
}

Verification

To verify the fix, we will test the following scenarios:

  • Switch to a model with a version suffix (e.g., vertex-ai_claude-haiku-4-5@20251001)
  • Switch to a model with an auth profile using the explicit prefix (e.g., vertex-ai_claude-haiku-4-5@profile:my-profile)

If the fix is successful, the full model ID should be passed to the provider as-is, and the model should be switched successfully.

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

openclaw - ✅(Solved) Fix [Bug]: Model ID with version suffix (@YYYYMMDD) is truncated by splitTrailingAuthProfile [3 pull requests, 2 comments, 3 participants]