[Bug] API Key missing from background model discovery/capabilities requests breaks tool support on llama.cpp
Description
When connecting OGAM to an remote llama.cpp server (llama-server) with an API key configured in custom server settings, available tool-calling / function-calling features disappear from the chat interface.
Inspecting server logs and verifying endpoints via curl confirms that OGAM drops the Authorization: Bearer <KEY> header during background model discovery and property inspection calls (GET /v1/models). llama-server rejects these unauthenticated background checks with 401 Unauthorized, causing OGAM to fall back to a "no-tools-supported" UI state and hide the tool options.
Steps to Reproduce
- Start
llama-serverwith--api-key <YOUR_KEY>enabled. - In OGAM custom server settings, set the endpoint URL (e.g.,
http://<SERVER_IP>:8080/v1) and input the matching API Key. - Observe
llama-serverterminal logs upon connecting: a series of401 Unauthorizederrors occur immediately on background requests. - Open a chat; tool-calling features are missing/disabled in the UI.
- Remove
--api-keyfromllama-serverand clear the API key in OGAM settings. - Reconnect—discovery succeeds with
200 OK, and tool features immediately become available.
Expected Behavior
OGAM should append the configured API Key (Authorization: Bearer <KEY>) to all outgoing HTTP requests sent to the remote OpenAI-compatible base URL, including initial model discovery (GET /v1/models), property evaluations (GET /v1/props), and text generation streams.
Actual Behavior
OGAM appears to omit the Authorization header during initial discovery calls, causing llama-server to return 401 Unauthorized and forcing OGAM to disable tool support for the endpoint.
Environment
- Platform: Android
- OS Version: Android 16
- Device: OnePlus 12r
- App Version: v0.0.110 - APK Download
- Model in use: Remote Server
gemm4-12b(GGUF viallama-server)
Logs
1.05.221.341 W srv operator(): unauthorized: Invalid API Key
1.05.258.326 W srv operator(): unauthorized: Invalid API Key
1.05.368.566 W srv operator(): unauthorized: Invalid API Key
1.05.516.514 W srv operator(): unauthorized: Invalid API Key
1.05.594.049 W srv operator(): unauthorized: Invalid API Key
1.05.627.454 W srv operator(): unauthorized: Invalid API Key
1.05.775.239 W srv operator(): unauthorized: Invalid API Key
1.05.991.369 W srv operator(): unauthorized: Invalid API Key