Skip to content

@kody-w/twin_agent v1.2.0 — chat action + auto-seed memory agents on summon#74

Open
kody-w wants to merge 1 commit into
mainfrom
feat/twin-agent-v1.2.0-chat-and-seed
Open

@kody-w/twin_agent v1.2.0 — chat action + auto-seed memory agents on summon#74
kody-w wants to merge 1 commit into
mainfrom
feat/twin-agent-v1.2.0-chat-and-seed

Conversation

@kody-w

@kody-w kody-w commented May 5, 2026

Copy link
Copy Markdown
Owner

Summary

Bumps @kody-w/twin_agent from 1.1.0 → 1.2.0 with two structural improvements that have already proven themselves on a local install while wiring an autonomous "kaizen monk" twin against the rappterverse repo.

1. New chat action — twins can talk to twins

Twin(action="chat",
     rappid_uuid="af4bd4d2-1a33-47bc-8648-4fc0669a1d9d",
     message="take one breath",
     session_id="<optional, to keep a thread>")

Forwards message to the twin's running /chat endpoint, returns its response (and a brief tail of agent_logs), and surfaces the new session_id for follow-up turns.

This closes a real gap: previously the only way for one brainstem to talk to another twin's brainstem was custom HTTP code in a separate agent. Now the natural Twin abstraction owns the full lifecycle — including conversation. Parent ↔ twin and twin ↔ twin become one tool call.

Failure modes are explicit (twin not running → "boot it first", connection error → labelled, non-JSON reply → labelled). 240s timeout to allow LLM round-trips.

2. Auto-seed memory agents on summon

Every newly summoned twin now ships with three canonical agents copied from the parent brainstem install into the twin's agents/ directory:

  • basic_agent.py
  • context_memory_agent.py
  • manage_memory_agent.py

So a twin is born with continuity. Previously, freshly summoned twins booted with agents=[] — no ContextMemory, no ManageMemory — and their first breath had no past. Operators were silently copying memory agents in by hand to make twins useful. This commit makes that the default.

The summon return string now includes a Seeded agents: line (and a ⚠ missing: line if anything didn't make it across), so it's obvious at-a-glance.

A new helper _detect_brainstem_dir() walks up from __file__ to find the brainstem source dir (with a ~/.brainstem/src/rapp_brainstem fallback), so the seeding works whether Twin is installed via the rapp-installer or sideloaded into a project-local install.

Compatibility

  • No breaking changes. All existing actions (hatch, boot, stop, list, update_identity, update_soul, lay_egg, overview, inspect, eggs, history, lineage) behave identically.
  • Stdlib only. No new dependencies. urllib.request (already imported) carries the chat call.
  • Manifest updated to 1.2.0 with refreshed description and tags (chat, memory).

Verification

  • python -m py_compile
  • Locally installed at /Users/kodywildfeuer/Documents/GitHub/rappterverse/.brainstem/src/rapp_brainstem/agents/twin_agent.py, parent brainstem reloaded, Twin agent shows up at /agents.
  • Twin (kaizen-monk, rappid af4bd4d2-…) successfully summoned with auto-seeded memory agents; restart confirmed agents=["ContextMemory","ManageMemory","RappterverseWorld"].
  • The chat action successfully bridges parent brainstem → kaizen-monk twin via plain English (Twin(action="chat", rappid_uuid=…, message="take one breath")).

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant