When running anda agent run --prompt "...", the command polls the daemon for completion but never returns, even though the LLM successfully responds to all requests and the last model response has finish_reason: "stop".
The conversation remains in a non-terminal state indefinitely, causing agent run to hit its --wait-timeout-secs limit and fail with:
Error: "agent did not complete conversation N within 300s"
To Reproduce
- Start the daemon with a custom OpenAI-compatible endpoint (tested with
llama.cpp serving gemma-4-26B)
- Run:
anda agent run --prompt "Di hola" --wait-timeout-secs 300
- Observe via proxy that the LLM responds correctly to all requests (~21 seconds)
- After the last model response, the engine does nothing for 4+ minutes until timeout
Evidence (proxy logs)
All requests to the LLM complete successfully with stop reasons:
13:53:46 REQ 1 → CHAT: "Di hola"
13:53:47 RES 1 → prompt=6742 comp=5 content="¡Hola!" finish_reason=stop ✅
13:53:47 REQ 2 → MEMORY FORMATION (KIP Brain)
13:53:59 RES 2 → prompt=18835 comp=477 tool_calls=[execute_kip] ✅
13:53:59 REQ 3 → MEMORY FORMATION with tool results
13:54:05 RES 3 → prompt=19397 comp=479 tool_calls=[execute_kip] ✅
13:54:05 REQ 4 → MEMORY FORMATION final
13:54:06 RES 4 → prompt=19925 comp=24 content=101 finish_reason=stop ✅
─────── ZERO requests to LLM for 4+ minutes ───────
13:58:46 → TIMEOUT: "agent did not complete conversation within 300s"
The LLM completed all 4 turns in ~21 seconds. The remaining 279 seconds were spent polling internally with no further LLM calls.
Expected behavior
After the final model response with finish_reason: "stop", the engine should mark the conversation as complete and agent run should return the response.
Environment
- anda_bot version: 0.11.3
- anda_engine version: 0.13.14 (from logs)
- OS: Debian 13 (Linux x86_64)
- LLM backend: llama.cpp (OpenAI-compatible API), model
gemma-4-26B-A4B-it-UD-Q4_K_XL.gguf
- Config:
stream: false, family: openai, no channels configured
- Running as: systemd daemon, headless server (no D-Bus/keyring)
Additional context
- The daemon itself stays
active (running) — it's the conversation state machine that never reaches terminal state
- This happens with both
stream: true and stream: false
- The proxy confirms all HTTP responses from the LLM are valid JSON with proper
finish_reason
- No errors appear in daemon logs beyond the keyring warning
- Hermes Agent and direct curl tests against the same llama.cpp endpoint work perfectly
- The issue is reproducible on every
agent run invocation
When running
anda agent run --prompt "...", the command polls the daemon for completion but never returns, even though the LLM successfully responds to all requests and the last model response hasfinish_reason: "stop".The conversation remains in a non-terminal state indefinitely, causing
agent runto hit its--wait-timeout-secslimit and fail with:To Reproduce
llama.cppservinggemma-4-26B)anda agent run --prompt "Di hola" --wait-timeout-secs 300Evidence (proxy logs)
All requests to the LLM complete successfully with stop reasons:
The LLM completed all 4 turns in ~21 seconds. The remaining 279 seconds were spent polling internally with no further LLM calls.
Expected behavior
After the final model response with
finish_reason: "stop", the engine should mark the conversation as complete andagent runshould return the response.Environment
gemma-4-26B-A4B-it-UD-Q4_K_XL.ggufstream: false,family: openai, no channels configuredAdditional context
active (running)— it's the conversation state machine that never reaches terminal statestream: trueandstream: falsefinish_reasonagent runinvocation