Skip to content

fix(runtime-host-bridge): strip provider prefix from admission-probe model id - #150

Open
thumay9700 wants to merge 1 commit into
try-works:devfrom
thumay9700:fix/model-id-prefix-upstream
Open

fix(runtime-host-bridge): strip provider prefix from admission-probe model id#150
thumay9700 wants to merge 1 commit into
try-works:devfrom
thumay9700:fix/model-id-prefix-upstream

Conversation

@thumay9700

Copy link
Copy Markdown

Problem

Activating a DeepSeek endpoint (e.g. deepseek/deepseek-v4-flash) leaves it permanently stuck at healthStatus: "provider-unavailable" with admission reasonCode: "vendor-down". The endpoint is therefore ineligible for benchmarking and routing, so the provider is unusable.

Root cause

The catalog stores provider-prefixed model ids (deepseek/deepseek-v4-flash), but OpenAI-compatible vendors expect the bare upstream id on the wire (deepseek-v4-flash).

The OpenAI execution adapter already handles this via resolveProviderLocalModelId() (provider-openai/src/index.ts), but the chat-completions admission probe (remote-health-probe.ts) builds its request body directly and sent the raw context.modelId:

const body = {
  model: context.modelId,   // "deepseek/deepseek-v4-flash"  ← wrong
  ...
};

DeepSeek rejects that with a 400:

{ "error": { "message": "The supported API model names are deepseek-v4-pro, deepseek-v4-flash, ... but you passed deepseek/deepseek-v4-flash.", ... } }

The probe classifies any non-401/403/404 as vendor-down, so a malformed model id was misreported as a vendor outage.

Fix

Strip the leading provider segment before probing, mirroring the execution adapter:

function resolveProbeModelId(modelId: string): string {
  const trimmed = modelId.trim();
  return trimmed.includes("/") ? trimmed.split("/").slice(1).join("/") : trimmed;
}

and send model: resolveProbeModelId(context.modelId).

Test

The existing admission-probe test actually asserted the bug (it expected deepseek/deepseek-v4-flash on the wire). Updated it to assert the bare upstream id, so it fails before this fix and passes after.

corepack pnpm --filter @role-model-router/runtime-host-bridge vitest run test/remote-endpoint-admission-probe.test.ts src/remote-health-probe.test.ts → 14/14 pass.

…model id

Catalog model ids are provider-prefixed (deepseek/deepseek-v4-flash), but
OpenAI-compatible vendors expect the bare upstream id (deepseek-v4-flash)
on the wire. The chat-completions admission probe sent the prefixed form,
so vendors returned 400 which was misclassified as vendor-down, leaving the
endpoint permanently provider-unavailable and ineligible for benchmarking.

Strip the leading provider segment before probing, mirroring
resolveProviderLocalModelId in the OpenAI execution adapter.
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for the contribution. Before this pull request can merge, every contributor must explicitly agree to the role-model CLA at https://raw.githubusercontent.com/try-works/role-model/cla-v1.0/cla/CLA-v1.0.md. Contributions are accepted only from individuals acting in their personal capacity. If an employer, client, company, or other entity has rights in the contribution, it must not be submitted here. To sign it, reply on this pull request with the exact sentence: I have read cla/CLA-v1.0.md and I hereby agree to the role-model Contributor License Agreement.


I have read cla/CLA-v1.0.md and I hereby agree to the role-model Contributor License Agreement.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant