Bug Description
delegate_task subagents fail with 404 Page Not Found from opencode.ai when using the opencode-go provider (model minimax-m2.7). The subagent gets an HTML 404 page (not API JSON), meaning auth completely fails.
Root Cause
tools/delegate_tool.py does NOT call load_hermes_dotenv() before spawning subagents. When resolve_runtime_provider(requested=opencode-go) is called in the child, OPENCODE_GO_API_KEY is not set in the child process environment, so the API key resolves to empty string. The request goes to the web UI (no auth) and gets a 404.
Fix
Add at top of tools/delegate_tool.py:
from hermes_cli.env_loader import load_hermes_dotenv
from pathlib import Path
_hermes_home = Path.home() / .hermes
_project_env = Path(__file__).parent / .env
load_hermes_dotenv(hermes_home=_hermes_home, project_env=_project_env)
Reproduction
- Set
OPENCODE_GO_API_KEY in ~/.hermes/.env
- Use opencode-go provider with
minimax-m2.7
- Call
delegate_task
- Subagent fails with HTML 404 page
Related
Bug Description
delegate_tasksubagents fail with 404 Page Not Found from opencode.ai when using theopencode-goprovider (modelminimax-m2.7). The subagent gets an HTML 404 page (not API JSON), meaning auth completely fails.Root Cause
tools/delegate_tool.pydoes NOT callload_hermes_dotenv()before spawning subagents. Whenresolve_runtime_provider(requested=opencode-go)is called in the child,OPENCODE_GO_API_KEYis not set in the child process environment, so the API key resolves to empty string. The request goes to the web UI (no auth) and gets a 404.Fix
Add at top of
tools/delegate_tool.py:Reproduction
OPENCODE_GO_API_KEYin~/.hermes/.envminimax-m2.7delegate_taskRelated