Skip to content

feat(router): warn when client-supplied model is rewritten#1550

Closed
laitingsheng wants to merge 1 commit into
mainfrom
feat/router-model-source
Closed

feat(router): warn when client-supplied model is rewritten#1550
laitingsheng wants to merge 1 commit into
mainfrom
feat/router-model-source

Conversation

@laitingsheng

@laitingsheng laitingsheng commented May 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The privacy router silently overwrites the client-supplied model with route.model, masking caller-side typos and stale references. Emit a warn-level tracing event when the supplied model differs from the configured route model. The rewrite itself is preserved.

Related Issue

Fixes NVIDIA/NemoClaw#994

Changes

  • crates/openshell-router/src/backend.rs — warn with client_model, route_model, and endpoint when the caller's non-empty model differs from route.model.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@github-actions

Copy link
Copy Markdown

@laitingsheng laitingsheng marked this pull request as draft May 24, 2026 04:26
@copy-pr-bot

copy-pr-bot Bot commented May 24, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

The privacy router silently overwrites the client-supplied `model` field
with the route's configured model before forwarding to the upstream
provider. The rewrite lets operators swap upstream models without
reconfiguring agents, but it also masks typos and stale model
references on the caller side — the upstream's "unknown model" error
never reaches the caller.

When the caller sends a non-empty model that differs from the
configured route model, emit a `warn`-level tracing event with both
identifiers and the route endpoint. The rewrite still happens (no
behaviour change for healthy deployments); operators get a visible
signal in logs whenever a caller and the route disagree on the model.

Fixes NVIDIA/NemoClaw#994

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@laitingsheng laitingsheng force-pushed the feat/router-model-source branch from ce3d85b to 7ac700a Compare May 25, 2026 02:13
@laitingsheng laitingsheng changed the title feat(router): per-route policy for client-supplied model field feat(router): warn when client-supplied model is rewritten May 25, 2026
@laitingsheng laitingsheng deleted the feat/router-model-source branch May 25, 2026 02:37
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.

[MacOS] Invalid model Id was ignored and returned successful response

1 participant