Brain into Rooms: convergence, persisted history, reply-loop fix, manual halt#662
Open
Wirasm wants to merge 1 commit into
Open
Brain into Rooms: convergence, persisted history, reply-loop fix, manual halt#662Wirasm wants to merge 1 commit into
Wirasm wants to merge 1 commit into
Conversation
…al halt
Follow-ups from the deep-dive review of the channel→Room rename.
- prompts: .pi/agents/{orchestrator,worker,reviewer} now say "room"/"participant"
to match the renamed primitive; drop the stray engine/.claude reviewer stub.
- brain: converge onto the real Room primitive — the brain opens/posts via the
roomManager (open_room/post_to_room) instead of the parallel CommsBus, which is
deleted along with the now-superseded rooms-demo. RoomManager gains postAs/messages.
- history: RoomRegistry write-throughs each room's log to $KILD_HOME/rooms/<id>.json
and loads past rooms into a read-only archive on start; GET /api/rooms/archive plus
cockpit rendering (read-only transcript, disabled composer).
- loop fix: an implicit reply (an agent's auto-posted turn-final narration) now
broadcasts but never delivers a turn, so two agents can't ping-pong on "staying
quiet". Prompting another agent requires an explicit post_message @mention, matching
the prompts. Adds two router tests.
- halt: a manual circuit breaker (room_halt) — the Topbar "halt" button stops a room's
agent sessions but keeps it read-only, vs ✕ which tears the room down.
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.
Follow-ups from the deep-dive review of the recent channel → Room rename. Five threads, one PR.
1. Agent prompts say "room" (#1)
.pi/agents/{orchestrator,worker,reviewer}.mdwere still describing a "channel" — the data agents actually read. Updated to "room" / "participant(s)" to match the primitive.2. Brain converged onto the real Room primitive (#2)
The brain talked over a separate
CommsBuswhile the cockpit used the real Room primitive — two things both called "room". Now the brain drives the same surface as the human:brain.tsgainsopen_room/post_to_roombacked byroomManager;RoomManagergainspostAs/messages.comms-bus.tsand the supersededrooms-demo.ts(the real multi-agent room demo iskild room --participants a,b,c).run_agent_in_worktree) — real participants are worker subprocesses that only bootstrap inside the engine, so standalone workflows can't spawn them.3. Room log persisted as read-only history (#3)
Rooms were in-memory only and vanished on every
--watchreload.RoomRegistrynow write-throughs each room's log to$KILD_HOME/rooms/<id>.jsonand loads past rooms into a read-only archive on start. NewGET /api/rooms/archive; the cockpit renders archived rooms as a read-only transcript (disabled composer). Participants stay dead — it's a record, not a resumable session.4. Fixed the agent reply-loop (#4, found live)
Two agents ping-ponged "standing by" / "(no response needed)" forever and burned tokens. Root cause: the implicit reply auto-posted an agent's turn-final narration as a delivered turn — so "I'll stay quiet" became a message that prompted the other agent, contradicting the prompts ("no one sees your normal output — only what you post"). Fix: an implicit reply now broadcasts but never delivers a turn; prompting another agent requires an explicit
post_message@mention. Two router tests lock it in.5. Manual circuit breaker (halt button)
A Topbar ⏹ halt button (
room_halt) stops a room's agent sessions but keeps it read-only — the operator can trip it to stop a runaway or off-track room without tearing it down (vs ✕ which closes it).Verification
typecheck✅,lint✅, 44 tests ✅ (+4),compile✅svelte-check✅ (0 errors)Notes
room-types.tsand a few files span more than one thread, so this is one commit rather than split.