Skip to content

Fix Hindsight dependency in Docker WebUI venv#1130

Closed
franksong2702 wants to merge 1 commit intonesquena:masterfrom
franksong2702:franksong2702/hindsight-client-docker-dependency
Closed

Fix Hindsight dependency in Docker WebUI venv#1130
franksong2702 wants to merge 1 commit intonesquena:masterfrom
franksong2702:franksong2702/hindsight-client-docker-dependency

Conversation

@franksong2702
Copy link
Copy Markdown
Contributor

Summary

Closes #926.

This fixes the two-container Docker setup where the WebUI process imports Hermes Agent code from a shared source volume, but runs in its own isolated /app/venv. Hindsight's Python client was available only when users manually installed it in the WebUI container, so the Hindsight memory provider could not import cleanly from WebUI Docker.

Root Cause

The Hermes Agent container and Hermes WebUI container have separate Python environments. Installing Hermes Agent source with [all] into the WebUI venv does not currently install Hindsight: upstream Hermes Agent includes honcho in [all], but does not include a Hindsight extra or hindsight-client there. The Hindsight plugin metadata declares hindsight-client>=0.4.22, and the PyPI distribution imports as hindsight_client / hindsight_client_api.

Changes

  • Add a Docker init check that installs hindsight-client>=0.4.22 into the WebUI container venv when missing.
  • Run that check outside the /app/venv/.deps_installed fast-restart guard so existing Docker venvs can self-heal after upgrading.
  • Keep requirements.txt unchanged so local non-Docker startup does not gain optional external memory-provider dependencies.
  • Add focused regression tests for the Docker-specific dependency path and fast-restart placement.
  • Update the changelog.

Verification

  • bash -n docker_init.bash
  • uvx pytest tests/test_issue926_hindsight_docker_dependency.py tests/test_issue569_579.py -q passed: 14 tests
  • git diff --check
  • Temporary venv install/import check confirmed hindsight-client==0.5.4 exposes hindsight_client and hindsight_client_api
  • Docker image build succeeded:
    • docker build --build-arg HERMES_VERSION=hindsight-926-smoke -t hermes-webui:hindsight-926 .
  • Docker first-start smoke passed:
    • temporary container ran /hermeswebui_init.bash
    • init installed hindsight-client==0.5.4
    • /app/venv/bin/python imported hindsight_client and hindsight_client_api
  • Docker fast-restart smoke passed:
    • manually uninstalled hindsight-client while preserving /app/venv/.deps_installed
    • restarted the same container
    • logs showed Dependencies already installed — skipping (fast restart) followed by Installing hindsight-client>=0.4.22
    • import succeeded again

Not Run

  • Full docker compose -f docker-compose.two-container.yml up with a live Hermes Agent container and mounted real agent source volume.

@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Absorbed and shipped in v0.50.224 (PR #1131). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hindsight memory provider not available (no module found)

2 participants