Skip to content

feat: add X-Cagent-Model-Name header to models gateway requests#1751

Merged
dgageot merged 2 commits intodocker:mainfrom
cogvel:feat/model-name-header
Feb 17, 2026
Merged

feat: add X-Cagent-Model-Name header to models gateway requests#1751
dgageot merged 2 commits intodocker:mainfrom
cogvel:feat/model-name-header

Conversation

@tdabasinskas
Copy link
Contributor

This might be useful for other model gateway implementations.

  • Add Name field to ModelConfig for runtime manifest name tracking
  • Add WithModelName httpclient option that sets X-Cagent-Model-Name header
  • Set ModelConfig.Name in teamloader and model switcher when resolving from config map
  • Include X-Cagent-Model-Name in OpenAI, Anthropic, and Gemini provider clients
  • Add httpclient tests for WithModelName, WithModel, and WithProvider

@tdabasinskas tdabasinskas requested a review from a team as a code owner February 16, 2026 14:56
- Add `Name` field to `ModelConfig` for runtime manifest name tracking
- Add `WithModelName` httpclient option that sets `X-Cagent-Model-Name` header
- Set `ModelConfig.Name` in teamloader and model switcher when resolving from config map
- Include `X-Cagent-Model-Name` in OpenAI, Anthropic, and Gemini provider clients
- Add httpclient tests for `WithModelName`, `WithModel`, and `WithProvider`

Signed-off-by: Tomas Dabašinskas <tomas.dabasinskas@cogvel.com>
@tdabasinskas tdabasinskas force-pushed the feat/model-name-header branch from e396daf to 8073fc3 Compare February 16, 2026 14:57
@dgageot
Copy link
Member

dgageot commented Feb 17, 2026

Hi @tdabasinskas, tanks for the contribution! Could you elaborate on the use case?

@tdabasinskas
Copy link
Contributor Author

tdabasinskas commented Feb 17, 2026

Hi @tdabasinskas, tanks for the contribution! Could you elaborate on the use case?

We use custom gateway via --models-gateway and we're interested to know the model names in the manifest (in addition to the provider model name).

Replace `nil` body parameter with `http.NoBody` in test HTTP requests to follow Go best practices and make the intent more explicit when no request body is needed.
@dgageot dgageot merged commit 025dcb3 into docker:main Feb 17, 2026
5 checks passed
@tdabasinskas tdabasinskas deleted the feat/model-name-header branch February 17, 2026 18:27
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.

2 participants