Skip to content

[Bug]: urlpattern port matching fails for services on non-default ports #496

Description

@ARCJ137442

Summary

OpenAI-compatible providers on non-default ports (e.g. http://192.168.3.10:1234) cannot be reached — TouchAI rejects the URL as not allowed on the configured scope.

Steps to reproduce

  1. Run a local LLM server (LM Studio, Ollama, vLLM) on a non-standard port, e.g. :1234
  2. Add an OpenAI-compatible provider in TouchAI settings with URL http://192.168.3.10:1234
  3. Click "Test Connection" or try to fetch models

Expected behavior

TouchAI should accept the URL and successfully connect to the OpenAI-compatible server.

Actual behavior

TouchAI shows:

url not allowed on the configured scope: http://192.168.3.10:1234/v1/models

Additionally, if the test passes the scope check, leaving API key empty causes:

OpenAI API key is missing. Pass it using the 'apiKey' parameter.

Affected area

  • tauri

TouchAI version

1.2.0

Environment

Windows 11, LM Studio on LAN (192.168.3.10:1234), Qwen models

Logs, screenshots, or recordings

Error message: url not allowed on the configured scope: http://192.168.3.10:1234/v1/models

Root cause: capabilities/default.json uses http://** which urlpattern normalizes port to "" (empty string). A URL with explicit :1234 produces port() = "1234", which does not match "".

Image

Fix in PR #498


AI assistance disclosure: This issue was authored with assistance from DeepSeek V4 Flash for root-cause analysis and initial reproduction steps. Human contributor reviewed and validated all findings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions