openfang icon indicating copy to clipboard operation
openfang copied to clipboard

[Bug] Web UI: Base URL save button disabled & config not loaded on restart (Win11)

Open ashuai opened this issue 9 months ago • 3 comments

On Windows 11, configuring custom base_url for local providers (Ollama, vLLM, LM Studio) is broken in two ways:

  1. Web UI: The "Save" button for Base URL remains disabled (grayed out), preventing users from saving changes via the interface. (Note: API Key saves successfully to the config file but fails to display in the UI after refresh).
  2. Config File: Manually editing config.toml to set a custom base_url has no effect. After restarting the application, it ignores the file and reverts to the default localhost URL.

Configuration Attempted Manually edited config.toml:

[default_model]
provider = "ollama"
model = "llama3.2"
api_key_env = "OLLAMA_API_KEY"
base_url = "http://10.0.0.22:9001"

Result: File contains the value, but application ignores it on startup.

Steps to Reproduce

  1. Web UI Issue:

    • Navigate to Settings -> Provider (e.g., Ollama).
    • Enter a custom Base URL.
    • Observation: The "Save" button remains gray/disabled.
    • Enter an API Key and Save.
    • Refresh page: API Key field is empty (though value exists in config.toml).
  2. Config File Issue:

    • Stop the application.
    • Verify config.toml contains base_url = "http://10.0.0.22:9001".
    • Restart the application.
    • Observation: App attempts to connect to default http://localhost:11434 (or similar), ignoring the custom IP. Connection fails.

Expected Behavior

  • "Save" button should enable when a valid Base URL is entered.
  • API Key should be visible in the UI if present in the config.
  • Application must read and apply base_url from config.toml on startup.

Actual Behavior

  • Web UI prevents saving Base URL.
  • Web UI fails to display saved API Key.
  • Backend ignores base_url in config.toml entirely, forcing defaults.

Environment

  • OpenFang Version: v0.2.3
  • OS: Windows 11
  • Browser: Microsoft Edge
  • Providers: Ollama, vLLM, LM Studio

Additional Context This makes it impossible to connect to any LLM not running on the exact default localhost port. The issue seems to be a combination of:

  1. Frontend validation logic incorrectly disabling the save button.
  2. Backend configuration loader failing to parse or apply the base_url field from TOML.

ashuai avatar Mar 01 '26 03:03 ashuai

On Windows 11, configuring custom base_url for local providers (Ollama, vLLM, LM Studio) is broken in two ways:

  1. Web UI: The "Save" button for Base URL remains disabled (grayed out), preventing users from saving changes via the interface. (Note: API Key saves successfully to the config file but fails to display in the UI after refresh).
  2. Config File: Manually editing config.toml to set a custom base_url has no effect. After restarting the application, it ignores the file and reverts to the default localhost URL.

Configuration Attempted Manually edited config.toml:

[default_model]
provider = "ollama"
model = "llama3.2"
api_key_env = "OLLAMA_API_KEY"
base_url = "http://10.0.0.22:9001"

Result: File contains the value, but application ignores it on startup.

Steps to Reproduce

  1. Web UI Issue:

    • Navigate to Settings -> Provider (e.g., Ollama).
    • Enter a custom Base URL.
    • Observation: The "Save" button remains gray/disabled.
    • Enter an API Key and Save.
    • Refresh page: API Key field is empty (though value exists in config.toml).
  2. Config File Issue:

    • Stop the application.
    • Verify config.toml contains base_url = "http://10.0.0.22:9001".
    • Restart the application.
    • Observation: App attempts to connect to default http://localhost:11434 (or similar), ignoring the custom IP. Connection fails.

Expected Behavior

  • "Save" button should enable when a valid Base URL is entered.
  • API Key should be visible in the UI if present in the config.
  • Application must read and apply base_url from config.toml on startup.

Actual Behavior

  • Web UI prevents saving Base URL.
  • Web UI fails to display saved API Key.
  • Backend ignores base_url in config.toml entirely, forcing defaults.

Environment

  • OpenFang Version: v0.2.3
  • OS: Windows 11
  • Browser: Microsoft Edge
  • Providers: Ollama, vLLM, LM Studio

Additional Context This makes it impossible to connect to any LLM not running on the exact default localhost port. The issue seems to be a combination of:

  1. Frontend validation logic incorrectly disabling the save button.
  2. Backend configuration loader failing to parse or apply the base_url field from TOML.

Rightpartners avatar Mar 01 '26 04:03 Rightpartners

I’m seeing similar results on macOS so don’t think it’s platform specific.

aptonline avatar Mar 01 '26 09:03 aptonline

Fixed in v0.2.4. Provider base_url input now initializes correctly for local providers even when the URL is empty. Also fixed providerUrlSaving reactivity.

jaberjaber23 avatar Mar 01 '26 17:03 jaberjaber23