fix: identity system, persistent memory, and VPS redeploy durability#4
Open
jbellsolutions wants to merge 5 commits into
Open
fix: identity system, persistent memory, and VPS redeploy durability#4jbellsolutions wants to merge 5 commits into
jbellsolutions wants to merge 5 commits into
Conversation
The agent had no system prompt and no conversation history — every turn
started cold. Three missing wire-ups fixed:
1. vault_memory.py — add parse_history() to convert the markdown log
back to OpenAI-style messages list so runtimes can pass it to LLMs.
2. hermes_self/invoke.py — load supersan.yaml system_prompt (cached),
load per-user vault history, pass both to every LLM call, then
write the turn back to vault so the next session can recall it.
3. bot.py — pass metadata={"user_id": str(chat_id)} on the Job so
invoke.py knows which conversation file to open/append.
Also: fix pyproject.toml missing pythonpath=["src"] so uv run pytest
works without PYTHONPATH override; clean 4 pre-existing ruff warnings
in bot.py (unused import, unsorted imports, asyncio.TimeoutError).
All 19 tests pass (11 unit + 8 smoke).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each deployed agent now sets AGENT_IDENTITY=<name> and gets its own system prompt loaded from orchestrator/config/identities/<name>.yaml. Supported names: supersan, coo, gtm, head_of_ops (one YAML per agent). Per-job override also works: job.metadata["identity"] = "coo" lets the orchestrator pin an identity at dispatch time without relying on env var. Prompts are cached per identity name so the YAML is only read once. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Send /identity to list available personas and the current one. Send /identity <name> to switch (e.g. /identity coo, /identity video_agent). The selected persona is stored per chat_id and passed as job.metadata["identity"] on every subsequent message, which causes hermes_self to load that agent's system_prompt from its YAML file. Adding a new agent persona is now: create the YAML, send /identity <name>. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… SETUP QUICKSTART gets a new Step 5 covering /identity in plain English: what it does, how to switch, how to create a new persona from a YAML file, and how to set AGENT_IDENTITY as the deployment default. SETUP gets a dedicated "Agent personas" section up front explaining how the system works, the four built-in personas, how to switch via Telegram, how to set a default per service, and a full walkthrough for creating a new persona from scratch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
start.sh now enables memory_enabled + user_profile_enabled in the profile config on every deploy, and seeds MEMORY.md / USER.md from config/memories/ on first boot (no-clobber so live edits survive). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hermes_self/invoke.pynow loads identity fromAGENT_IDENTITYenv var, injects the system prompt fromidentities/<name>.yaml, loads conversation history from vault, and writes turns back after each response/identitycommand: Telegram users can switch agent personas mid-conversation without redeployingscripts/start.shenablesmemory_enabled/user_profile_enabledin the Hermes profile config and seedsMEMORY.md/USER.mdfromconfig/memories/on first boot (no-clobber — live edits survive)Why
The Hermes gateway was amnesiac — it re-explained already-decided architecture (SDR fleet design, delegate_task limits, subordinate agent patterns) every session because:
invoke.pynever passed a system prompt or history to the LLMmemory_enableddefaults tofalsein Hermes profilesFiles changed
src/agent_os/runtimes/hermes_self/invoke.pysrc/agent_os/orchestrator/adapters/vault_memory.pyparse_history()src/agent_os/channels/telegram/bot.pyuser_idin Job metadatasrc/agent_os/orchestrator/adapters/plan_overrides.py/identitycommand parsingscripts/start.shconfig/memories/MEMORY.mdconfig/memories/USER.mdQUICKSTART.md,SETUP.mdTest plan
./scripts/start.shcreatesmemories/MEMORY.mdandmemories/USER.md/identity→ lists personas;/identity coo→ switches to COO🤖 Generated with Claude Code