Skip to content

fix(openclaw): trigger open-webui recreate on install; simplify volume layout#1035

Open
yasinBursali wants to merge 2 commits intoLight-Heart-Labs:mainfrom
yasinBursali:fix/openclaw-recreate-overlay
Open

fix(openclaw): trigger open-webui recreate on install; simplify volume layout#1035
yasinBursali wants to merge 2 commits intoLight-Heart-Labs:mainfrom
yasinBursali:fix/openclaw-recreate-overlay

Conversation

@yasinBursali
Copy link
Copy Markdown
Contributor

@yasinBursali yasinBursali commented Apr 24, 2026

Summary

  • Host agent now recreates open-webui after a successful openclaw install so the overlay's OPENAI_API_BASE_URLS + OPENAI_API_KEYS env actually reaches the running container (previously silently broken until a manual dream restart).
  • Drops the openclaw-home named Docker volume entirely. Verified against ghcr.io/openclaw/openclaw:2026.3.8 — openclaw only writes two paths under /home/node/.openclaw/: openclaw.json (regenerated by inject-token.js every start) and workspace/ (bind-mounted). The named volume held only regenerated content.
  • Phase 06 directory-setup comment updated; stale ./data/openclaw/home row removed from openclaw/README.md.
  • Follow-up commit (e9e992fa) drops three stale --no-deps references from explainer comments — PR fix(host-agent): start extension sidecars during install #1021 dropped that flag from the install codepath, so the comments now describe the present-day install command (up -d <ext> without --force-recreate) accurately.

Platform Impact

  • macOS / Linux / Windows-WSL2: identical. Python host-agent + Docker Compose mount semantics are platform-agnostic. No platform branches introduced.

Testing

  • pytest tests/test_host_agent.py45 passed on the rebased branch (40 pre-existing including fix(host-agent): start extension sidecars during install #1021's TestInstallStartCommandNoDeps that came in via rebase + 5 new covering the _post_install_core_recreate helper).
  • docker compose -f docker-compose.base.yml -f extensions/services/searxng/compose.yaml -f extensions/services/openclaw/compose.yaml config merges cleanly; grep -c openclaw-home in merged output → 0.
  • make lint clean.
  • Manual (any platform): enable openclaw via dashboard → docker exec dream-webui env | grep OPENAI_API_BASE_URLS shows openclaw URL without a full stack restart; docker inspect dream-openclaw shows 3 bind mounts and no named volume.

Existing-install migration

The old openclaw-home Docker volume becomes orphaned after upgrade. Contents are non-critical (regenerated openclaw.json + misc caches). Users can reclaim disk with docker volume rm openclaw-home post-upgrade. No data loss.

Review notes

  • _post_install_core_recreate is hardcoded to openclaw (helper exists next to docker_compose_recreate). Kept scope-tight rather than introducing a manifest-level post_install_requires_recreate field for a single use case.
  • Triple-layered failure isolation (helper swallows, call site wraps, daemon thread) — intentional for daemon-thread safety.

🤖 Generated with Claude Code

@Lightheartdevs
Copy link
Copy Markdown
Collaborator

Audit follow-up after today's merge wave: this PR was approved in the backlog audit, but it now needs a small rebase before it can land.

What changed: #1021 merged first, as planned. After that, GitHub reports this PR as conflicting. I reproduced the conflict locally by merging current main into the PR branch. The production files auto-merged; the conflict is in dream-server/extensions/services/dashboard-api/tests/test_host_agent.py, where this PR's OpenClaw post-install recreate tests collide with #1021's new TestInstallStartCommandNoDeps regression tests.

Recommended fix: rebase on current main and keep both test blocks. I did not see a new product-level concern in this conflict; it is a test-file placement/merge conflict.

…e layout

The openclaw extension bundles an open-webui overlay that adds
OPENAI_API_BASE_URLS + OPENAI_API_KEYS to register openclaw as a model
provider. The install path uses `docker compose up -d --no-deps openclaw`,
so the overlay env never reached the already-running open-webui
container — the "openclaw in Open WebUI" feature silently broke until a
manual `dream restart`.

Adds a minimal _post_install_core_recreate helper in the host agent that
recreates open-webui after a successful openclaw install. Helper is a
no-op for other services; hardcoded rather than manifest-driven to keep
scope tight. Wrapped in try/except so install success isn't blocked by
a recreate failure (the progress write happens first).

Also simplifies the openclaw volume layout. The openclaw-home named
volume held only regenerated content (openclaw.json is rebuilt by
inject-token.js on every container start) plus incidental caches —
verified by inspecting the openclaw image filesystem. Removing it
eliminates a named-volume/bind-mount overlap at /home/node/.openclaw/,
simplifies the compose, and introduces zero data-loss risk for fresh
installs. Existing installs: the orphaned openclaw-home volume can be
reclaimed with `docker volume rm openclaw-home` — contents are
non-critical.

Phase 06 directory-setup comment updated to reflect the new behavior.
Also drops a stale Volume Mounts row in openclaw/README.md that
referenced a bind that never existed in compose.yaml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yasinBursali yasinBursali force-pushed the fix/openclaw-recreate-overlay branch from 0bd49a2 to 900bc71 Compare April 28, 2026 19:50
@yasinBursali
Copy link
Copy Markdown
Contributor Author

Rebased on current main. Resolved the tests/test_host_agent.py conflict per your guidance — kept both #1021's TestInstallStartCommandNoDeps block and this PR's TestPostInstallCoreRecreate + TestRunInstallCallsPostInstallRecreate blocks. Each test class has its own _install_source helper. pytest tests/test_host_agent.py → 45 passed (38 pre-existing + 5 openclaw + 2 no-deps regression).

…lainers

PR Light-Heart-Labs#1021 dropped --no-deps from the install command path. Three comments
in this branch's neighborhood still referenced the old form when
explaining WHY the post-install core recreate is needed:

  bin/dream-host-agent.py:348   docstring of _post_install_core_recreate
  bin/dream-host-agent.py:1260  call-site comment in _handle_install
  tests/test_host_agent.py:328  comment block above TestPostInstallCoreRecreate

The underlying causal claim is unchanged: docker compose up -d <ext>
won't recreate already-running siblings without --force-recreate. Comments
now describe the present-day install command accurately, with the missing
--force-recreate flag named as the reason recreate is required, instead
of the no-longer-passed --no-deps flag.

No behaviour change. 45 host-agent tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yasinBursali
Copy link
Copy Markdown
Contributor Author

Follow-up commit e9e992fa per CG review: dropped 3 stale --no-deps references in comments — PR #1021 dropped that flag from the install codepath, so the explainer text now describes the present-day install command (up -d <ext> without --force-recreate) accurately. Underlying logic unchanged. pytest tests/test_host_agent.py still 45 passed. Description updated.

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.

2 participants