Files
hope-voice-api/tests
snowspeeder 360e3276b0
Rebuild & Deploy / rebuild (push) Successful in 3m18s
feat: switch LLM to OpenWebUI with live model selection
- Point the agent at OpenWebUI's OpenAI-compatible API (LLM_BASE_URL,
  LLM_API_KEY, LLM_MODEL) with GEMMA_* env fallbacks
- Add list_available_models() fetching {base_url}/models, filtering
  non-chat ids (embedding/reranker)
- Rename GemmaLLM -> HopeLLM with update_options(model=...) for runtime
  model switching (mutates _opts.model) and instance-based compaction
- Data channel: agent publishes {type: models} after connect and on
  get_models; set_model switches live and acks model_changed
- Web UI: Brain section in the settings sheet with a model picker that
  persists the choice in localStorage
- Update tests, CI workflow env, and docs for the new endpoint
2026-08-29 12:09:03 -04:00
..

Hope test suite

End-to-end tests that drive the actual running container — no mocks. They run on the host and hit the live web UI, token endpoint, LLM API, MCP tool servers, and agent process.

Prerequisites

  • The container is up: docker compose up -d (and healthy)
  • Host deps installed: pip install -r tests/requirements.txt (or uv pip install -r tests/requirements.txt)
  • The LLM at LLM_BASE_URL (default http://192.168.86.2:3005/api, OpenWebUI) is reachable
  • Internet access for the weather tool tests (wttr.in)

Run

cd /home/shane/dev/voice
python -m pytest tests/ -v            # everything
python -m pytest tests/ -v -m "not slow"   # skip LLM/network-heavy tests

What each file covers

File Target Notes
test_web_ui.py nginx HTTPS UI (:9178) + token endpoint (:8091) static assets, /token (direct + via nginx), /livekit/ proxy
test_llm_api.py LLM API directly completion, tool calling, enable_thinking=false latency, streaming
test_mcp_tools.py MCP servers via docker exec weather/time, authenticated remote memory save/recall/delete, and local skills — probes are cleaned up
test_agent_integration.py running container agent process alive, worker registered with LiveKit, all 4 supervised processes up, container health, LiveKit HTTP API
test_compaction.py HopeLLM._compact_context in-container compaction triggers >24 items, system prompt preserved, short context untouched

Notes

  • LLM and MCP tests are marked @pytest.mark.slow (1–30s each).
  • The token endpoint is POST /token → {"token": "<JWT>"}.
  • Process checks use /proc/*/cmdline because the container image has no ps, and the supervisorctl unix socket is not exposed in this build.