eca icon indicating copy to clipboard operation
eca copied to clipboard

no models in custom provider

Open 11111000000 opened this issue 7 months ago • 5 comments

Describe the bug

ECA 0.123.2 reads a custom provider from =config.json= correctly, but the provider is not registered as an available runtime model. As a result:

  • =/config= shows the provider and =defaultModel= correctly
  • =/providers-list= shows the provider as configured, but with =0 models=
  • =/doctor= shows empty =Default model:=
  • chat requests can fail with: #+begin_src text :results output API url not found. Make sure you have provider '' configured properly. #+end_src

This seems to affect custom OpenAI-compatible providers configured with =api: "openai-chat"= and explicit static models in config.

To Reproduce

  1. Create =~/.config/eca/config.json= with a custom provider, for example: #+begin_src json :results output { "$schema": "https://eca.dev/config.json", "defaultModel": "aitunnel/qwen3.5-397b-a17b", "providers": { "aitunnel": { "api": "openai-chat", "url": "https://api.aitunnel.ru/v1", "key": "REDACTED", "fetchModels": false, "models": { "qwen3.5-397b-a17b": {} } } } } #+end_src
  2. Start ECA server.
  3. Open chat and run =/config=.
  4. Run =/providers-list= and =/doctor=.
  5. Send a normal chat message.

Expected behavior

If a custom provider is present in =/config= and has explicit static models in =providers..models=, ECA should register those models as available runtime models even when =fetchModels=false=.

Expected result:

  • =/providers-list= should show at least 1 model for the custom provider
  • =/doctor= should show a non-empty =Default model:=
  • chat should use =aitunnel/qwen3.5-397b-a17b= successfully

Actual behavior

  • =/config= shows the merged config correctly, including:
    • =defaultModel "aitunnel/qwen3.5-397b-a17b"=
    • the custom provider
    • =fetchModels false=
    • the static =models= entry
  • =/providers-list= shows: #+begin_src text :results output aitunnel ✓ configured API Key · (config) · active api: openai-chat url: https://api.aitunnel.ru/v1 fetchModels: false 0 models #+end_src
  • =/doctor= shows: #+begin_src text :results output Default model:

Logged providers: openai: Unknown #+end_src

  • sending a chat message can fail with: #+begin_src text :results output API url not found. Make sure you have provider '' configured properly. #+end_src

Doctor

#+begin_src text :results output ECA version: 0.123.2

Server cmd: /home/zoya/.emacs.d/eca/eca server

Workspaces: /home/zoya/.config/eca

Default model:

Logged providers: openai: Unknown #+end_src

Additional context

From source inspection, this looks like a runtime model registration / initialization issue rather than a config parsing issue:

  • =/config= proves the config is loaded correctly
  • custom providers with =api "openai-chat"= appear to be supported by runtime dispatch
  • the failure seems to happen because the custom model does not end up in =db[:models]=
  • chat/model selection then has no valid runtime model to use
  • there may also be an initialization race, because model sync is started asynchronously during startup

Relevant symptoms are consistent with:

  • static models from custom providers not being surfaced into available models
  • or chat starting before model sync completes
  • or both

11111000000 avatar Apr 04 '26 19:04 11111000000

@11111000000 there is no /providers-list command in ECA, only the providers page via eca-providers for emacs. I can't repro that, if I configure:

{
  "providers": {
        "aitunnel": {
            "api": "openai-chat",
            "url": "https://api.aitunnel.ru/v1",
            "key": "REDACTED",
            "fetchModels": false,
            "models": {"qwen3.5-397b-a17b": {}}
        }

  }
}

I do get the model after eca initialize, and if I send a message I get a error because of the token, but everything is expected:

Image

ericdallo avatar Apr 04 '26 20:04 ericdallo

I see the same bug

no model selected. /models says "No models available."

Image

i just installed eca and followed https://eca.dev/config/models/ and put this in ~/.config/eca/config.json

{
  "providers": {
    "my-company": {
      "api": "openai-chat",
      "url": "aa",
      "key": "bb",
      "models": {
        "gpt-5": {},
        "deepseek-r1": {}
       }
    }
  }
}

I am on windows . there seem to path issue with Workspaces

Image

vjohansen avatar May 31 '26 08:05 vjohansen

@vjohansen adding your config I do get the models properly, so let's see if there is anything in logs, can you setup debug logs and check them please?

ericdallo avatar May 31 '26 13:05 ericdallo

log below, but i found the issue

I used M-x eca-open-global-configto open the config file which opens the file

c:/Users/vagn/AppData/Roaming/.config/eca/config.json

If I copy this file to

c:/Users/vagn/.config/eca/config.json

it can see the models but I am unable not select one

Image

hmm. it is because I copy and paste from the buffer and there are around model name. Why is there not completion after /model ..?

14:02:19.200 DEBUG [NETWORK] Resolved network config: {:ca-cert-file nil, :client-cert nil, :client-key nil, :client-key-passphrase nil}
14:02:19.200 DEBUG [HATO] client-config: {:executor #object[java.util.concurrent.ThreadPoolExecutor 0x700e7012 "java.util.concurrent.ThreadPoolExecutor@700e7012[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]"]}
14:02:19.216 INFO  [server] Starting server...
14:02:19.216 INFO  [DB] No existing DB cache found for C:\Users\vagn\.cache\eca\db.transit.json
14:02:19.216 INFO  [DB] read-cache 0ms
14:02:19.232 INFO  [DB] read-cache 12ms
14:02:19.232 INFO  [DB] Loading from workspace-cache caches...
14:02:19.232 INFO  [ECA] initialize 21ms
14:02:19.232 INFO  [ECA] initialized 0ms
14:02:19.232 DEBUG [PLUGINS] No plugins in install, skipping
14:02:19.613 DEBUG [MODELS] [834] Provider 'openai': Fetching models from https://api.openai.com/v1/models
14:02:19.613 DEBUG [MODELS] [8980] Provider 'anthropic': Fetching models from https://api.anthropic.com/v1/models
14:02:19.613 DEBUG [MODELS] [6821] Provider 'github-copilot': Fetching models from https://api.githubcopilot.com/models
14:02:19.613 DEBUG [MODELS] [7] Provider 'google': Fetching models from https://generativelanguage.googleapis.com/v1beta/openai/models
14:02:19.771 WARN  [MODELS] Provider 'google': /models endpoint returned status 400
14:02:19.771 INFO  [MODELS] Provider 'google': Using models.dev provider-id fallback (url 'https://generativelanguage.googleapis.com/v1beta/openai' not matched)
14:02:19.771 INFO  [MODELS] Provider 'google': Loaded 21 models from models.dev
14:02:19.819 WARN  [MODELS] Provider 'anthropic': /models endpoint returned status 401
14:02:19.819 INFO  [MODELS] Provider 'anthropic': Using models.dev provider-id fallback (url 'https://api.anthropic.com' not matched)
14:02:19.819 INFO  [MODELS] Provider 'anthropic': Loaded 24 models from models.dev
14:02:19.883 WARN  [MODELS] Provider 'openai': /models endpoint returned status 401
14:02:19.883 INFO  [MODELS] Provider 'openai': Using models.dev provider-id fallback (url 'https://api.openai.com' not matched)
14:02:19.883 INFO  [MODELS] Provider 'openai': Loaded 52 models from models.dev
14:02:19.994 WARN  [MODELS] Provider 'github-copilot': /models endpoint returned status 400
14:02:19.994 INFO  [MODELS] Provider 'github-copilot': Loaded 21 models from models.dev
14:02:19.994 INFO  [MODELS] Fetched model catalogs from 4 providers in 374.1ms
14:02:21.019 INFO  [LLM-API] Default LLM model 'null' decision ':no-available-model'
14:02:23.522 INFO  [ECA] chat-query-commands 0ms
14:02:23.670 INFO  [ECA] chat-query-commands 0ms
14:02:23.731 INFO  [ECA] chat-query-commands 0ms
14:02:23.826 INFO  [ECA] chat-query-commands 0ms
14:02:23.906 INFO  [ECA] chat-query-commands 0ms
14:02:23.987 INFO  [ECA] chat-query-commands 0ms
14:02:25.067 INFO  chat=682ee228-8697-4b1d-9ca7-17f39e018f43 [LLM-API] Default LLM model 'null' decision ':no-available-model'
14:02:25.115 INFO  chat=682ee228-8697-4b1d-9ca7-17f39e018f43 [LLM-API] Default LLM model 'null' decision ':no-available-model'
14:02:25.131 INFO  chat=682ee228-8697-4b1d-9ca7-17f39e018f43 [DB] upsert-cache 4ms
14:02:25.131 INFO  [ECA] chat-prompt 69ms

vjohansen avatar May 31 '26 14:05 vjohansen

Interesting, it might be a issue for windows where it's not looking for the config in the same place 🤔 Besides that looks correct, you may select the model with eca-chat-select-model

ericdallo avatar May 31 '26 14:05 ericdallo