6.5 KiB
Agent instructions for Hermes WebUI
This file is the shared entry point for AI assistants working in this repository. Keep it project-specific and safe to publish. Do not put personal machine setup, private network details, credentials, tokens, or local-only workflow notes here.
Documentation by task
Use the references that match the change; there is no blanket reading list for unrelated work. Keep subsystem-specific safety and contract requirements below.
README.mdfor product behavior, setup, usage, and the docs indexCONTRIBUTING.mdfor contribution scope, PR format, and review requirementsdocs/CONTRACTS.mdto find the contract/RFC for the subsystem being changeddocs/GUIDELINES.mdfor bug-class coverage, state ownership, and evidence standardsCHANGELOG.mdfor release-history questions; ordinary PRs do not edit itARCHITECTURE.mdfor design constraints and current module layoutTESTING.mdfor local verification commands and relevant manual checksdocs/onboarding.mdfor first-run onboarding behaviordocs/troubleshooting.mdfor diagnostic flowsdocs/rfcs/README.mdfor larger RFCs and state/durability contractsdocs/UIUX-GUIDE.mdandDESIGN.mdfor layout, interaction flow, themes, chat rendering, and composer chrome
Onboarding and reinstall support
If the task involves install, reinstall, bootstrap, first-run onboarding,
provider setup, local model server setup, Docker onboarding, WSL onboarding, or
support for a failed first run, read docs/onboarding-agent-checklist.md
before running commands or inspecting logs.
Follow that checklist's safety rules:
- use isolated
HERMES_HOMEandHERMES_WEBUI_STATE_DIRfor trials unless the human explicitly asks to use real state - do not delete or overwrite a real
~/.hermesdirectory without explicit approval - do not print API keys, OAuth tokens, cookies, full
.envfiles, fullauth.jsonfiles, or password hashes - collect non-secret status and log evidence before recommending a fix
Contribution style
- Keep one logical change per PR; split unrelated refactors or cleanup.
- Read
docs/CONTRACTS.mdand the linked contract/RFC for the touched subsystem before editing. - For local pytest runs, use
./scripts/test.shinstead of barepython3,python -m pytest, orpytest. The script creates/uses the repo.venv, pins execution to Python 3.11-3.13, and installs missing dev test dependencies.HERMES_WEBUI_TEST_PYTHONselects the supported base interpreter used to create or rebuild.venv; it must not install test dependencies into a system/Homebrew interpreter directly. If a direct pytest invocation reports an unsupported interpreter, rerun through./scripts/test.shbefore debugging product code. - Prefer the existing Python + vanilla JavaScript structure. Do not add dependencies, build tools, frameworks, or long-lived processes without clear justification and a rollback story.
- Update docs when changing setup, onboarding, runtime behavior, architecture, testing guidance, or user-facing workflows.
- Do not edit
CHANGELOG.mdin ordinary contributor PRs. The release workflow owns changelog updates through release commits. If a change is release-note worthy, include concise release-note wording in the PR body instead. - For UI or UX changes, include before/after evidence and test relevant desktop, narrow, and mobile states.
- For behavior changes, add or update automated tests where practical and list the manual verification performed.
- For runtime, streaming, recovery, replay, compression, or sidebar metadata changes, name the state layer being mutated and prove the relevant invariant.
- For Docker build changes in
docker_init.bash, mirror directory exclusions in both thersyncandcp -apaths —/opt/hermesmay contain subdirectories with restricted permissions (e.g..playwright/).
Completion and verification
A change is ready for review when:
- The requested scope is implemented, with related call sites and lifecycle paths covered or explicitly identified as out of scope; unrelated cleanup is absent.
- Behavior changes have observable regression evidence where practical, including proof that a bug-fix test fails before the fix and passes after it. Evidence covers affected and neighboring tests, not only new tests.
- State changes identify the authoritative value and its owner, use that value through decision, action, and persistence, and account for cleanup on every exit. Fallbacks and defaults extend the existing mechanism rather than duplicate it.
- UI changes include before/after evidence at desktop and narrow widths and cover relevant mobile interactions; controls fit their frequency of use.
- Relevant docs are current. The PR body follows
CONTRIBUTING.md, includesContract Routing(andContract Changefor intentional contract changes) where required bydocs/CONTRACTS.md, and reports actual commands, outcomes, assumptions, and anything not verified. Mocks are not proof of external behavior.
Within the requested scope, you may run local tests with disposable fixtures,
fix failures caused by the change, and rerun affected tests without asking for
approval at each step. Use ./scripts/test.sh for pytest as specified above.
This permission applies only with confirmed isolated state and no live
credentials or services; the runner manages Python dependencies but is not a
network sandbox. It does not authorize modifying real state, handling credentials,
restarting existing services, or exposing the app beyond localhost. Those actions
require explicit human approval and the onboarding safety rules still apply.
If verification is blocked, report the blocker rather than claim completion.
Local state and secrets
Hermes WebUI can read and write real agent state, sessions, workspaces, credentials, and cron data. Treat local validation as potentially destructive unless you have confirmed the active state directories.
For authority, capability, identity, or containment checks, fail closed when safety cannot be confirmed: unknown is not allowed. Validate adversarial inputs at the point of use, account for check-then-use races, and scope caches by the complete identity so profiles and sessions cannot leak into each other.
Prefer isolated trial state for experiments:
HERMES_HOME=/tmp/hermes-webui-agent-home \
HERMES_WEBUI_STATE_DIR=/tmp/hermes-webui-agent-state \
HERMES_WEBUI_PORT=8789 \
python3 bootstrap.py
Do not include private machine instructions in this tracked file. Use a git-ignored local note for personal workflow details.