From c04076426a8b9525322b7a350ab241c100daf268 Mon Sep 17 00:00:00 2001 From: Lao Uncle Date: Fri, 31 Jul 2026 17:13:28 +0000 Subject: [PATCH 1/5] feat: enhance Dockerfile to include TUI build for dashboard's embedded chat tab --- .devcontainer/Dockerfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0c3286ce..2c44fec9 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,7 +9,7 @@ ARG OLLAMA_VERSION=0.32.5 # Use the official Ollama image to get the binary FROM ollama/ollama:${OLLAMA_VERSION} AS ollama-bin -# ── Node.js builder: ModelRelay + OmniRoute + Hermes Web UI ───────────── +# ── Node.js builder: ModelRelay + OmniRoute + Hermes Web UI + TUI ─────── FROM node:24-slim AS node-builder ARG OMNIROUTE_VERSION @@ -52,6 +52,17 @@ RUN git clone --depth 1 --branch ${HERMES_VERSION} https://github.com/NousResear && cp -r ../hermes_cli/web_dist /build/web_dist \ && rm -rf /tmp/hermes +# ── Hermes TUI ──────────────────────────────────────────────────────── +# Build the TUI bundle (dist/entry.js) and copy to hermes_cli/tui_dist +# so the dashboard's embedded chat tab can spawn the TUI without a full workspace +RUN git clone --depth 1 --branch ${HERMES_VERSION} https://github.com/NousResearch/hermes-agent.git /tmp/hermes-tui \ + && cd /tmp/hermes-tui/ui-tui \ + && npm install --silent \ + && npm run build \ + && mkdir -p /build/tui_dist \ + && cp dist/entry.js /build/tui_dist/ \ + && rm -rf /tmp/hermes-tui + # ── Python builder: Hermes Agent venv ──────────────────────────────────── # Using 3.11-slim because hermes-agent requires Python >=3.11. # We copy the full Python 3.11 runtime into the final image so venv works. @@ -161,6 +172,8 @@ COPY --from=node-builder /build/omniroute/ /usr/local/lib/omniroute/ # The venv's non-editable install puts hermes_cli in site-packages, so # web_dist must go there for the dashboard --skip-build to find it. COPY --from=node-builder /build/web_dist/ /usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/hermes_cli/web_dist/ +# The TUI bundle (tui_dist/entry.js) is needed for the dashboard's embedded chat tab +COPY --from=node-builder /build/tui_dist/ /usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/hermes_cli/tui_dist/ # ── Copy Hermes Agent venv from python-builder ──────────────────────── # Non-editable install: venv is self-contained, no source tree needed. From 6bd39fd137926ee25612f449a6692f77a043705f Mon Sep 17 00:00:00 2001 From: Lao Uncle Date: Fri, 31 Jul 2026 17:52:50 +0000 Subject: [PATCH 2/5] dev --- .devcontainer/Dockerfile | 2 +- .hermes | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 .hermes diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2c44fec9..820a220e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -101,7 +101,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Copy the Ollama binary from the official image COPY --from=ollama-bin --chown=1000:1000 /usr/bin/ollama /usr/local/bin/ollama -# ── System packages + ALL heavy installs in ONE layer ────────────────── +# ── System packages + ALL heavy installs in ONE layer ──────────────────. RUN apt-get update \ && apt-get install -y --no-install-recommends \ zsh ripgrep jq curl git ca-certificates gnupg zstd sudo \ diff --git a/.hermes b/.hermes new file mode 120000 index 00000000..9f7b2377 --- /dev/null +++ b/.hermes @@ -0,0 +1 @@ +/home/vscode/.hermes \ No newline at end of file From 67cdc6c4fb4faf6651ab623be03c4296e69b6217 Mon Sep 17 00:00:00 2001 From: Lao Uncle Date: Fri, 31 Jul 2026 17:54:48 +0000 Subject: [PATCH 3/5] dev --- .github/workflows/devcontainer-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devcontainer-ci.yml b/.github/workflows/devcontainer-ci.yml index a4bdeec8..4201a493 100644 --- a/.github/workflows/devcontainer-ci.yml +++ b/.github/workflows/devcontainer-ci.yml @@ -7,7 +7,7 @@ on: - '.devcontainer/**' - '!.devcontainer/screen-shot.png' pull_request: - branches: [main] + branches: [main, dockerizeation2] paths: - '.devcontainer/**' - '!.devcontainer/screen-shot.png' From 7d1e70a8049d6a30418a3e54dba0530f321146e3 Mon Sep 17 00:00:00 2001 From: Lao Uncle Date: Fri, 31 Jul 2026 18:34:40 +0000 Subject: [PATCH 4/5] dev --- .devcontainer/Dockerfile | 14 +- GITHUB_ACTIONS_TESTING_PLAN.md | 239 --------------------------------- 2 files changed, 11 insertions(+), 242 deletions(-) delete mode 100644 GITHUB_ACTIONS_TESTING_PLAN.md diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 820a220e..988ce27a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -74,10 +74,20 @@ ARG HERMES_VERSION RUN apt-get update && apt-get install -y --no-install-recommends git \ && rm -rf /var/lib/apt/lists/* +# Clone hermes-agent source (separate RUN so the prebuilt bundles can be +# injected into the tree BEFORE pip install below) +RUN git clone --depth 1 --branch ${HERMES_VERSION} https://github.com/NousResearch/hermes-agent.git /tmp/hermes + +# Inject the prebuilt TUI bundle into the source tree before `pip install .`. +# pyproject.toml declares tui_dist/**/* as package-data, so with the bundle +# present the wheel is built WITH it and the venv becomes self-contained — +# the dashboard's embedded chat PTY resolves hermes_cli/tui_dist/entry.js +# at runtime, and no last-minute copy into site-packages is needed. +COPY --from=node-builder /build/tui_dist/ /tmp/hermes/hermes_cli/tui_dist/ + # Build Hermes Agent Python venv (non-editable so venv is self-contained) # IMPORTANT: venv path must match COPY destination in final stage for shebangs to work RUN mkdir -p /usr/local/lib/hermes-agent \ - && git clone --depth 1 --branch ${HERMES_VERSION} https://github.com/NousResearch/hermes-agent.git /tmp/hermes \ && cd /tmp/hermes \ && python -m venv /usr/local/lib/hermes-agent/venv \ && /usr/local/lib/hermes-agent/venv/bin/pip install --no-cache-dir . \ @@ -172,8 +182,6 @@ COPY --from=node-builder /build/omniroute/ /usr/local/lib/omniroute/ # The venv's non-editable install puts hermes_cli in site-packages, so # web_dist must go there for the dashboard --skip-build to find it. COPY --from=node-builder /build/web_dist/ /usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/hermes_cli/web_dist/ -# The TUI bundle (tui_dist/entry.js) is needed for the dashboard's embedded chat tab -COPY --from=node-builder /build/tui_dist/ /usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/hermes_cli/tui_dist/ # ── Copy Hermes Agent venv from python-builder ──────────────────────── # Non-editable install: venv is self-contained, no source tree needed. diff --git a/GITHUB_ACTIONS_TESTING_PLAN.md b/GITHUB_ACTIONS_TESTING_PLAN.md deleted file mode 100644 index bf0b64db..00000000 --- a/GITHUB_ACTIONS_TESTING_PLAN.md +++ /dev/null @@ -1,239 +0,0 @@ -# GitHub Actions Testing Plan for Hermes-CodeSpace Dev Container - -## Overview -This document outlines a phased approach to implementing GitHub Actions CI/CD for testing the dev container. The plan is designed for incremental adoption — start simple, add complexity as needed. - ---- - -## Phase 1: Minimal Viable CI (Week 1) -**Goal**: Verify dev container builds and health check passes on every push/PR. - -### Workflow File: `.github/workflows/devcontainer-ci.yml` - -```yaml -name: Dev Container CI - -on: - push: - branches: [main, readme] - pull_request: - branches: [main] - -jobs: - test-devcontainer: - name: Build & Health Check - runs-on: ubuntu-latest - timeout-minutes: 25 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Build dev container & run health check - uses: devcontainers/ci@v0.3 - with: - imageName: hermes-codespace-test-${{ github.run_id }} - push: never - runCmd: | - set -e - echo "=== Running post-create (one-time setup) ===" - bash .devcontainer/post-create-cmd.sh - - echo "=== Running post-start (service startup) ===" - bash .devcontainer/post-start-cmd.sh & - - echo "=== Waiting for services to stabilize ===" - sleep 60 - - echo "=== Running health check ===" - bash .devcontainer/self-check.sh -``` - -### Success Criteria -- [ ] Workflow runs on push to `main` and `readme` -- [ ] Workflow runs on PRs to `main` -- [ ] Build completes in < 20 minutes -- [ ] `self-check.sh` exits with code 0 (healthy) - ---- - -## Phase 2: Service Smoke Tests (Week 2) -**Goal**: Verify each service responds on its expected port. - -### Additional Steps in `runCmd`: - -```bash -echo "=== Smoke testing service ports ===" -# ModelRelay -curl -sf http://localhost:7352/v1/models > /dev/null && echo "✓ ModelRelay (7352)" || echo "✗ ModelRelay" - -# OmniRoute -curl -sf http://localhost:20128/v1/models > /dev/null && echo "✓ OmniRoute (20128)" || echo "✗ OmniRoute" - -# Hermes Gateway -curl -sf http://localhost:9119/health > /dev/null && echo "✓ Hermes Gateway (9119)" || echo "✗ Hermes Gateway" - -# Ollama -curl -sf http://localhost:11434/api/tags > /dev/null && echo "✓ Ollama (11434)" || echo "✗ Ollama" -``` - -### Success Criteria -- [ ] All 4 services respond to HTTP requests -- [ ] Failures are clearly reported in logs - ---- - -## Phase 3: CLI & Integration Tests (Week 3) -**Goal**: Verify CLI tools work and can route requests. - -### Additional Steps in `runCmd`: - -```bash -echo "=== CLI version checks ===" -hermes --version -claude --version -omniroute --version -mnemon --version - -echo "=== OmniRoute model listing ===" -omniroute model list - -echo "=== Integration: Hermes one-shot via gateway ===" -# Start gateway in background if not already running -hermes gateway run & -sleep 10 - -# Test via REST API -curl -sf -X POST http://localhost:9119/v1/chat/completions \ - -H "Content-Type: application/json" \ - -d '{"model":"auto-fastest","messages":[{"role":"user","content":"Say hello"}],"max_tokens":10}' \ - | jq -r '.choices[0].message.content' && echo "✓ Hermes API works" || echo "✗ Hermes API failed" -``` - -### Success Criteria -- [ ] All CLIs report versions without error -- [ ] OmniRoute lists configured models (including `auto-fastest`) -- [ ] Hermes gateway responds to chat completion request - ---- - -## Phase 4: Memory & Persistence Tests (Week 4) -**Goal**: Verify Mnemon memory layer works across the stack. - -### Additional Steps in `runCmd`: - -```bash -echo "=== Mnemon memory test ===" -mnemon remember "CI test memory" --category test --importance 3 -mnemon recall "CI test" --limit 1 | grep -q "CI test memory" && echo "✓ Mnemon works" || echo "✗ Mnemon failed" - -echo "=== Hermes memory integration ===" -# Hermes should auto-use Mnemon when configured -hermes "Remember that the test value is 42" & -sleep 5 -hermes "What is the test value?" | grep -q "42" && echo "✓ Hermes memory works" || echo "✗ Hermes memory failed" -``` - ---- - -## Phase 5: Optimizations & Enhancements (Ongoing) - -| Enhancement | Effort | Benefit | -|-------------|--------|---------| -| **Docker layer caching** | Low | 50% faster builds | -| **Matrix testing** (Ubuntu latest + LTS) | Medium | Catch OS regressions | -| **Publish test images to GHCR** | Low | Debug failed builds locally | -| **Dependabot + auto-merge** | Low | Keep base image/deps current | -| **Parallel job for integration tests** | Medium | Faster feedback | -| **Annotate health check failures** | Low | Better PR UX | - -### Docker Layer Caching Example: -```yaml -- name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - -- name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- -``` - ---- - -## Implementation Checklist - -### Files to Create/Modify -- [ ] `.github/workflows/devcontainer-ci.yml` (Phase 1) -- [ ] `.github/workflows/devcontainer-integration.yml` (Phase 3, optional separate workflow) -- [ ] Update `.devcontainer/self-check.sh` to output JSON for GitHub annotations (optional) - -### Self-Check Script Enhancements (Optional) -Modify `self-check.sh` to support CI-friendly output: -```bash -# Add --json flag for machine-readable output -# Exit codes: 0=healthy, 1=warnings, 2=critical -# Output to /tmp/health-report.json (already done) -``` - -### GitHub Annotations (Optional) -```yaml -- name: Parse health report - if: always() - run: | - if [ -f /tmp/health-report.json ]; then - cat /tmp/health-report.json | jq -r '.checks[] | "::warning file=.devcontainer/self-check.sh::\(.name): \(.message)"' - fi -``` - ---- - -## Estimated Timeline - -| Phase | Est. Time | Cumulative | -|-------|-----------|------------| -| Phase 1: Minimal CI | 30 min | 30 min | -| Phase 2: Service Smoke | 20 min | 50 min | -| Phase 3: CLI Integration | 30 min | 80 min | -| Phase 4: Memory Tests | 20 min | 100 min | -| Phase 5: Optimizations | 60 min | 160 min | - ---- - -## Next Agent Instructions - -**To continue implementation:** - -1. **Start with Phase 1** — Create `.github/workflows/devcontainer-ci.yml` using the minimal workflow above -2. **Test locally first** — Run `act` or push to a test branch to verify -3. **Iterate** — Add Phase 2-4 steps incrementally -4. **Monitor** — Watch first 5-10 runs for flakiness (free model APIs can be unreliable) - -**Key files to reference:** -- `.devcontainer/post-create-cmd.sh` — One-time setup (~10 min) -- `.devcontainer/post-start-cmd.sh` — Service startup (~30 sec) -- `.devcontainer/self-check.sh` — Health check (exit codes: 0/1/2) -- `.devcontainer/Makefile` — Has `update-deps` target for upstream sync - -**Common pitfalls to avoid:** -- Don't run `post-create-cmd.sh` on every CI run — it's slow. Consider a pre-built base image. -- Services need 45-60s to fully start; `sleep 60` is conservative but reliable. -- Free model endpoints (OmniRoute/ModelRelay) may return 5xx — health check should distinguish infra vs. model failures. - ---- - -## Decision Points for User - -Before Phase 2+, confirm: -1. **Should CI run on every push, or only PRs + main?** -2. **Acceptable CI runtime?** (Current: ~15-20 min with full post-create) -3. **Publish test images to GHCR** for debugging failed builds? -4. **Separate integration workflow?** (Runs less frequently, more thorough) -5. **Annotate PRs with health check failures?** (Requires self-check JSON output) - ---- - -*Generated: 2026-07-19* -*Branch: readme* -*Next: Implement Phase 1 workflow* \ No newline at end of file From 8535816ad8d2827f8a47c853b2a99daa3c29d676 Mon Sep 17 00:00:00 2001 From: Lao Uncle Date: Fri, 31 Jul 2026 18:52:51 +0000 Subject: [PATCH 5/5] dev --- .github/workflows/devcontainer-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devcontainer-ci.yml b/.github/workflows/devcontainer-ci.yml index 4201a493..a4bdeec8 100644 --- a/.github/workflows/devcontainer-ci.yml +++ b/.github/workflows/devcontainer-ci.yml @@ -7,7 +7,7 @@ on: - '.devcontainer/**' - '!.devcontainer/screen-shot.png' pull_request: - branches: [main, dockerizeation2] + branches: [main] paths: - '.devcontainer/**' - '!.devcontainer/screen-shot.png'