Skip to content

Custom Inference: setting a Model alias appends a carriage return to the model name sent to the endpoint #14782

Description

@mwolfe08

Summary

On a Custom Inference endpoint, filling in the optional Model alias field causes
the request to be sent with a trailing carriage return glued to the Model name
value. The provider then rejects it with a "model not found" error, because
glm-5.2:cloud\r is not an exact match for glm-5.2:cloud.

Clearing the Model alias field makes the same endpoint, model, and API key work
immediately. Nothing else changes.

The UI describes this field as "aliases for the model picker in your input", i.e.
a display label. It should not affect the wire payload at all.

Environment

  • Warp v0.2026.07.29.09.05.stable_02 (stable)
  • Windows 11, 10.0.26200
  • API schema: OpenAI Chat Completions
  • Endpoint URL: https://ollama.com/v1
  • Model name: glm-5.2:cloud
  • Model alias: a short display label along the lines of GLM 5.2. I did not record
    the exact string, but it was a plain human-readable label -- not the model
    name, and not something I would have pasted from a file.

Steps to reproduce

  1. Settings -> AI -> Custom Inference -> Add custom model.
  2. API schema: OpenAI Chat Completions. Endpoint URL: https://ollama.com/v1.
    Provide a valid API key for the provider.
  3. Add a model with Model name = glm-5.2:cloud.
  4. Fill in Model alias with any short display label (e.g. GLM 5.2).
  5. Save, select that model, and send any agent request.

Expected

The request body carries "model": "glm-5.2:cloud". The alias is used only as the
label in the model picker.

Actual

The request fails:

Response stream finished unexpectedly with internal error:
POST "https://ollama.com/v1/chat/completions": 404 Not Found
{"message":"model \"glm-5.2:cloud\\r\" not found","type":"not_found_error","param":null,"code":null}

Note the \r in the model name echoed back by the provider. The model tag itself is
valid (glm-5.2:cloud is a published tag; ollama.com/library/glm-5.2/tags lists
tools, thinking, cloud), and the same key and endpoint succeed once the alias
is cleared.

Workaround

Leave Model alias empty.

Hypothesis (unverified)

Looks like CRLF-vs-LF handling when the model list is serialized/deserialized on
Windows: if rows are stored as a newline-delimited blob written with CRLF and then
split on \n only, the trailing \r stays attached to the last field of each row.
That would explain why the corruption appears only once a second field per row is
populated. I have not read the relevant code to confirm this, so treat the mechanism
as a guess -- the reproduction above is the reliable part.

Why this one is unpleasant to diagnose

The corrupting character is invisible in every UI that displays the value, and it is
not whitespace, so any trim()-style guard passes it through. The resulting error is
visually indistinguishable from a genuine typo in the model name, which sends users
hunting the endpoint URL and API key instead of the field that actually broke.

Suggested fix, independent of root cause: strip surrounding whitespace and control
characters from the model identifier before serializing it into the request body.

Metadata

Metadata

Assignees

Labels

area:agentAgent workflows, conversations, prompts, cloud mode, and AI-specific UI.area:settings-keybindingsSettings UI, preferences, keybindings, and keyboard-shortcut management.bugSomething isn't working.factory-auto-implementQueued for automated implementation by the Warp factoryos:windowsWindows-specific behavior, regressions, or requests.repro:highThe report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.warp:auto-triage-review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions