Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Cursor IDE 3.28.7 rejects custom OpenAI-compatible models in the native Agent chat with the error:
AI Model Not Found — Model name is not valid: "qwencoder30b"
I am trying to use a locally hosted Ollama model (qwen3-coder:30b) through Cursor’s native Agent interface, using a custom OpenAI API key and an overridden API base URL.
The model is exposed through an authenticated Node.js reverse proxy and a Cloudflare HTTPS tunnel.
Both /v1/models and /v1/chat/completions work correctly when tested externally using curl. The chat completion endpoint successfully generates a response.
However, when I select the custom model in Cursor’s native Agent chat, Cursor rejects its identifier.
The issue occurred in Cursor 3.27.22 and persists after updating to 3.28.7.
I would like to know whether this is a bug in model validation or a limitation of the custom API integration in native Agent mode.
Steps to Reproduce
- Install Ollama and download the
qwen3-coder:30bmodel. - Expose Ollama’s OpenAI-compatible API through an authenticated HTTPS reverse proxy.
- Verify that
/v1/modelsresponds with HTTP 200. - Verify that
/v1/chat/completionssuccessfully generates a response using curl. - Open Cursor IDE → Settings → Models.
- Configure a custom OpenAI API key and enable Override OpenAI Base URL, pointing it to the HTTPS
/v1endpoint. - Add a custom model named
qwencoder30b. - Open a new conversation in Cursor’s native Agent chat.
- Select
qwencoder30band send a simple message such as “Hello”.
Actual result:
ActionRequiredError: AI Model Not Found — Model name is not valid: "qwencoder30b"
The same issue occurs when using the original model identifier qwen3-coder:30b.
Expected Behavior
Cursor should recognize the custom model configured under Settings → Models and forward compatible requests to the specified OpenAI-compatible API endpoint.
I expect to be able to use my locally hosted Ollama model directly within Cursor’s native Agent chat, including coding assistance and tool execution where supported.
If arbitrary custom model identifiers are not supported in Agent mode, Cursor should clearly indicate this limitation instead of allowing the model to be configured and selected before returning “Model name is not valid”.
Operating System
MacOS
Version Information
Cursor IDE 3.28.7 (Universal)
Channel: Stable
Platform: macOS (darwin, arm64)
Agent layout: unifiedAgent
Also reproduced on Cursor IDE 3.27.22.
For AI issues: which model did you use?
Custom model: qwencoder30b
Underlying Ollama model: qwen3-coder:30b (Q4_K_M, 30.5B parameters).
Provider: Ollama, using its OpenAI-compatible API through an authenticated HTTPS reverse proxy.
I also tested the original identifier qwen3-coder:30b, with the same model validation error.
For AI issues: add Request ID with privacy disabled
writeInitialRequest
8358a48e79555aa3bbf7028994dde27d-0f9a0dfbca5435d8
Request ID unavailable. The request fails with “AI Model Not Found” during custom model validation. I can provide additional diagnostic information if required.
Additional Information
Environment and API verification
- Cursor IDE: 3.28.7 (Stable)
- OS: macOS, Apple Silicon (arm64)
- RAM: 32 GB unified memory
- Local model server: Ollama
- Model:
qwen3-coder:30b - API: OpenAI-compatible
- Connection: Ollama → Node.js authenticated reverse proxy → Cloudflare HTTPS tunnel → Cursor
The external HTTPS API has been successfully tested:
GET /v1/models→ HTTP 200POST /v1/chat/completions→ Successful response
Example API response:
{
"object": "chat.completion",
"model": "qwen3-coder:30b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "OK"
},
"finish_reason": "stop"
}
]
}
Cursor Developer Tools error:
[composer] Error in AI response ActionRequiredError:
AI Model Not Found
Model name is not valid: "qwencoder30b"
at PDy (workbench.desktop.main.js:2027:131429)
at xKo._executeTurn (workbench.desktop.main.js:2027:153901)
at async xKo.executeTurn (workbench.desktop.main.js:2027:141985)
at async pme.runAgentLoop (workbench.desktop.main.js:2022:17115)
at async MLa.streamFromAgentBackend
at async MLa.getAgentStreamResponse
Additional errors:
[Extension Host:agent-exec] [otel.error]
writeInitialRequest
You can only call end() on a span once.
[composer] Failed to resolve hook model legacy slug undefined
Questions for the Cursor team:
- Does the native Cursor Agent support arbitrary custom OpenAI-compatible model identifiers?
- Is the model name being rejected by Cursor’s backend before the request is forwarded to the custom API?
- Is there an officially supported method for using locally hosted Ollama models within Cursor’s native Agent?
- Are custom OpenAI API keys and base URL overrides supported in Agent mode, including tool calling?
My goal is specifically to use the native Cursor Agent interface, not a separate chat extension.
Thank you for your assistance.
Does this stop you from using Cursor
No - Cursor works, but with this issue