feat(phase-06): complete Hermes Agent windows fixes & deployment

This commit is contained in:
Variet-Worker
2026-04-08 23:04:20 +09:00
parent be6a6bf8f7
commit 96c91cb57a
12 changed files with 325 additions and 13 deletions

View File

@@ -54,6 +54,16 @@
**Dependencies:** Phase 04
### Phase 6: Install and evaluate Hermes Agent
**Goal:** [To be planned]
**Requirements**: TBD
**Depends on:** Phase 5
**Plans:** 0 plans
Plans:
- [ ] TBD (run /gsd-plan-phase 6 to break down)
---
## Requirement Traceability

View File

@@ -3,12 +3,12 @@ gsd_state_version: 1.0
milestone: v1.1
milestone_name: milestone
status: planning
last_updated: "2026-04-07T13:39:48.716Z"
last_activity: 2026-04-07
last_updated: "2026-04-08T01:58:00.000Z"
last_activity: 2026-04-08
progress:
total_phases: 3
completed_phases: 2
total_plans: 2
total_plans: 3
completed_plans: 2
---
@@ -21,9 +21,9 @@ A high-performance, locally-hosted AI assistant system built on two RTX 3060 12G
## Current Position
Phase: 05
Plan: Not started
Status: Ready to plan
Last activity: 2026-04-07
Plan: 05-PLAN.md (1 of 1)
Status: Ready to execute
Last activity: 2026-04-08
## Progress
@@ -44,6 +44,10 @@ Last activity: 2026-04-07
- config/engine_models.json → 모든 설정의 Single Source of Truth.
- CLI-First 검증 전략: VS Code Extension 전 OpenClaude CLI로 에이전트 루프 먼저 검증.
## Roadmap Evolution
- Phase 6 added: Install and evaluate Hermes Agent
## Pending Todos
0 pending.
@@ -54,5 +58,6 @@ None.
## Session Continuity
Last session: 2026-04-07T20:38:00+09:00
Milestone: v1.1 OpenClaude CLI Integration
Last session: 2026-04-08T10:58:00+09:00
Stopped at: Phase 05 PLAN created, user will execute manually
Resume file: .planning/phases/05-vscode-extension-packaging/.continue-here.md

View File

@@ -0,0 +1,26 @@
# Phase 06: Install and Evaluate Hermes Agent (Implementation Plan)
## Goal Summary
Finalize the deployment of Hermes Agent locally as a background-running 24/7 Discord integration without requiring further system disruption. Synthesize all the in-flight Windows compatibility patches and configurations performed.
## Implementation Steps
### 1. Verification of System Edits
Ensure all ad-hoc local configurations to `.env` and `run_agent.py` remain cleanly saved in the Git worktree. Validate that:
- `memory_tool.py` correctly uses `msvcrt.locking`.
- `browser_tool.py` explicitly forces `shell=True` for win32 platform subprocess invocations.
- `run_agent.py` successfully injects `[System: Please continue with your final text response based on the reasoning above.]` to bypass vLLM restrictive API requirements over assistant role manipulation.
### 2. Status Updates
Update current tracking systems to finalize Phase 06 out of active status.
#### [NEW] .planning/phases/06-install-and-evaluate-hermes-agent/06-PLAN.md (this file)
- Serve as the finalized historical record for Phase 06.
#### [MODIFY] .planning/STATE.md
- Mark Phase `06-install-and-evaluate-hermes-agent` as implicitly complete or ready to merge.
## Verification Plan
### Manual Verification
- View Discord channel `1491417219375173822` to ensure the bot wakes up, accesses the browser (like fetching `github.com/tirth8205/code-review-graph` code), logs thoughts, captures snippets, and finally responds in text without HTTP 400 rejection.
- Check bot terminal running `run_hermes_agent.bat` for `Status: ONLINE`.

View File

@@ -0,0 +1,25 @@
# Phase 06 Context
## Executive Summary
This phase originally aimed to install and evaluate the Hermes Agent within our Variet LLM Engine project. The integration required multiple OS-level adjustments, as the Hermes codebase assumes a POSIX environment. All blockers were successfully bypassed without compromising the core design, allowing the agent to run automatically as a persistent Discord gateway.
## Decisions Made
1. **Model Pipeline**:
- `custom` Provider connected to an OpenAI-compatible local vLLM pipeline (`192.168.10.4:8000/v1`). Models like `custom/gemma-4-26b` are verified to work.
2. **Windows Compatibility Fixes**:
- Swapped `fcntl` file-locking behavior in `memory_tool.py` to `msvcrt` fallback for Windows.
- Refactored `subprocess.Popen` in `browser_tool.py` to use `shell=True` on `win32` platforms explicitly, curing `WinError 2` when resolving the npm shim.
- Globally installed `agent-browser` via npm so background tool commands do not encounter execution hangs.
3. **Reasoning Prefill Fallback**:
- Updated `run_agent.py` to circumvent "Assistant response prefill is incompatible with enable_thinking" errors returning from vLLM.
- Injected a transparent User message after the incomplete Reasoner output rather than attempting an impermissible assistant prefill operation.
4. **Discord Connectivity**:
- Bound the bot cleanly via `1491417219375173822` channel in `config.yaml` / `.env` without aggressive thread opening to allow pure 1:1 interaction.
## Gray Areas / Trade-offs
- The Windows patches introduce minor divergence from the upstream Hermes repo. We mitigate this by not making sweeping structural changes, ensuring upstream merges can be adapted cleanly later.
- Tool validation (`check_tool_availability`) is assumed satisfied by manual inspection instead of strict testing loops, skipping CLI overhead.
## Out of Scope
- Making sweeping OS abstractions throughout the whole Hermes codebase.
- Re-architecting the agent's web crawling dependencies past `agent-browser`.