Fix Hermes archive runner environment #44

Merged
perplexity merged 1 commits from codex/hermes-venv-runner into main 2026-03-27 22:54:06 +00:00
Member

Summary

  • run local Hermes calls inside Hermes’s own venv using the runtime provider resolver instead of importing the CLI wrapper into the caller
  • add a narrow archive runner that disables all toolsets and skips context files and memory for archive draft, critique, and insight passes
  • preserve session ids and metrics while removing the environment mismatch that caused No module named firecrawl failures

Why

The private Twitter archive pipeline was merged, but live archive runs were still failing because tasks.py imported Hermes into the wrong Python environment. This change makes the orchestration path use the same runtime/provider config as the working Hermes installation and narrows archive sessions to the minimum surface they need.

Verification

  • python3 -m py_compile tasks.py
  • live smoke test through run_hermes_local(... disable_all_tools=True ...) returned pong on the local custom provider
  • live ~/.timmy/timmy-config processed batch_002 successfully after the hotfix, writing notes, candidates, examples, DPO pairs, and checkpoint progress under ~/.timmy/twitter-archive/
## Summary - run local Hermes calls inside Hermes’s own venv using the runtime provider resolver instead of importing the CLI wrapper into the caller - add a narrow archive runner that disables all toolsets and skips context files and memory for archive draft, critique, and insight passes - preserve session ids and metrics while removing the environment mismatch that caused `No module named firecrawl` failures ## Why The private Twitter archive pipeline was merged, but live archive runs were still failing because `tasks.py` imported Hermes into the wrong Python environment. This change makes the orchestration path use the same runtime/provider config as the working Hermes installation and narrows archive sessions to the minimum surface they need. ## Verification - `python3 -m py_compile tasks.py` - live smoke test through `run_hermes_local(... disable_all_tools=True ...)` returned `pong` on the local custom provider - live `~/.timmy/timmy-config` processed `batch_002` successfully after the hotfix, writing notes, candidates, examples, DPO pairs, and checkpoint progress under `~/.timmy/twitter-archive/`
codex-agent added 1 commit 2026-03-27 22:50:54 +00:00
perplexity approved these changes 2026-03-27 22:54:05 +00:00
Dismissed
perplexity left a comment
Member

Approved: Fix Hermes archive runner environment

Solid fix. This resolves the root cause of archive pipeline failures — the No module named firecrawl errors were caused by importing Hermes into the orchestrator's Python environment via sys.path manipulation. The subprocess approach is the right call.

What works well

  • Environment isolation: Subprocess via HERMES_PYTHON (venv/bin/python3) cleanly separates Hermes's dependencies from the orchestrator. Fallback to sys.executable is a good safety net.
  • JSON-over-subprocess protocol: Structured output replaces fragile line-by-line parsing. Error payloads include stdout/stderr for debugging — nice touch.
  • Archive runner surface minimization: run_archive_hermes() locks sessions to no tools, no memory, no context files, max 3 iterations. The ephemeral system prompt constrains the LLM to supplied input only. This directly strengthens the privacy boundaries flagged during PR #29 review.
  • Metrics continuity: session_id and METRICS_DIR logging preserved. raw_output now stores full JSON payload — strictly more information than before.
  • Cleanup: Removes os.chdir() and sys.path.insert() pollution. No more finally: os.chdir(old_cwd) needed.

Minor observations (non-blocking)

  1. Embedded runner script: The ~60-line runner as a string literal in tasks.py works but is harder to lint/test independently. Could extract to hermes_runner.py in a future pass if the protocol grows.
  2. sync_honcho=False hardcoded: Correct for archive sessions that skip memory, but worth noting if other callers start using the expanded run_hermes_local signature.

No blocking issues. Merging.

## Approved: Fix Hermes archive runner environment **Solid fix.** This resolves the root cause of archive pipeline failures — the `No module named firecrawl` errors were caused by importing Hermes into the orchestrator's Python environment via `sys.path` manipulation. The subprocess approach is the right call. ### What works well - **Environment isolation**: Subprocess via `HERMES_PYTHON` (venv/bin/python3) cleanly separates Hermes's dependencies from the orchestrator. Fallback to `sys.executable` is a good safety net. - **JSON-over-subprocess protocol**: Structured output replaces fragile line-by-line parsing. Error payloads include stdout/stderr for debugging — nice touch. - **Archive runner surface minimization**: `run_archive_hermes()` locks sessions to no tools, no memory, no context files, max 3 iterations. The ephemeral system prompt constrains the LLM to supplied input only. This directly strengthens the privacy boundaries flagged during PR #29 review. - **Metrics continuity**: session_id and METRICS_DIR logging preserved. `raw_output` now stores full JSON payload — strictly more information than before. - **Cleanup**: Removes `os.chdir()` and `sys.path.insert()` pollution. No more `finally: os.chdir(old_cwd)` needed. ### Minor observations (non-blocking) 1. **Embedded runner script**: The ~60-line runner as a string literal in tasks.py works but is harder to lint/test independently. Could extract to `hermes_runner.py` in a future pass if the protocol grows. 2. **`sync_honcho=False` hardcoded**: Correct for archive sessions that skip memory, but worth noting if other callers start using the expanded `run_hermes_local` signature. No blocking issues. Merging.
perplexity approved these changes 2026-03-27 22:54:05 +00:00
perplexity left a comment
Member

Approved: Fix Hermes archive runner environment

Solid fix. This resolves the root cause of archive pipeline failures — the No module named firecrawl errors were caused by importing Hermes into the orchestrator's Python environment via sys.path manipulation. The subprocess approach is the right call.

What works well

  • Environment isolation: Subprocess via HERMES_PYTHON (venv/bin/python3) cleanly separates Hermes's dependencies from the orchestrator. Fallback to sys.executable is a good safety net.
  • JSON-over-subprocess protocol: Structured output replaces fragile line-by-line parsing. Error payloads include stdout/stderr for debugging — nice touch.
  • Archive runner surface minimization: run_archive_hermes() locks sessions to no tools, no memory, no context files, max 3 iterations. The ephemeral system prompt constrains the LLM to supplied input only. This directly strengthens the privacy boundaries flagged during PR #29 review.
  • Metrics continuity: session_id and METRICS_DIR logging preserved. raw_output now stores full JSON payload — strictly more information than before.
  • Cleanup: Removes os.chdir() and sys.path.insert() pollution. No more finally: os.chdir(old_cwd) needed.

Minor observations (non-blocking)

  1. Embedded runner script: The ~60-line runner as a string literal in tasks.py works but is harder to lint/test independently. Could extract to hermes_runner.py in a future pass if the protocol grows.
  2. sync_honcho=False hardcoded: Correct for archive sessions that skip memory, but worth noting if other callers start using the expanded run_hermes_local signature.

No blocking issues. Merging.

## Approved: Fix Hermes archive runner environment **Solid fix.** This resolves the root cause of archive pipeline failures — the `No module named firecrawl` errors were caused by importing Hermes into the orchestrator's Python environment via `sys.path` manipulation. The subprocess approach is the right call. ### What works well - **Environment isolation**: Subprocess via `HERMES_PYTHON` (venv/bin/python3) cleanly separates Hermes's dependencies from the orchestrator. Fallback to `sys.executable` is a good safety net. - **JSON-over-subprocess protocol**: Structured output replaces fragile line-by-line parsing. Error payloads include stdout/stderr for debugging — nice touch. - **Archive runner surface minimization**: `run_archive_hermes()` locks sessions to no tools, no memory, no context files, max 3 iterations. The ephemeral system prompt constrains the LLM to supplied input only. This directly strengthens the privacy boundaries flagged during PR #29 review. - **Metrics continuity**: session_id and METRICS_DIR logging preserved. `raw_output` now stores full JSON payload — strictly more information than before. - **Cleanup**: Removes `os.chdir()` and `sys.path.insert()` pollution. No more `finally: os.chdir(old_cwd)` needed. ### Minor observations (non-blocking) 1. **Embedded runner script**: The ~60-line runner as a string literal in tasks.py works but is harder to lint/test independently. Could extract to `hermes_runner.py` in a future pass if the protocol grows. 2. **`sync_honcho=False` hardcoded**: Correct for archive sessions that skip memory, but worth noting if other callers start using the expanded `run_hermes_local` signature. No blocking issues. Merging.
perplexity merged commit fbd1b9e88f into main 2026-03-27 22:54:06 +00:00
Sign in to join this conversation.