Repository navigation
Description
Written-by: Dev
Part of #796 (token spend per Bot turn). Owner request 2026-10-24 00:53 Asia/Shanghai: find and fix token waste per Bot turn.
Defect
Every group turn re-sends the group's fixed text and stores it in the member's group Session, so the history keeps one copy per turn.
core/src/host/groups.jsroomPrompt(~line 244-273 onc90af02) builds each turn's text from the members line,ROOM_CALLS, the full group notice, the admin note / face-room lead note, the face roster (faceRoster), andROOM_REPLY, plus the round (transcript, speaking order).core/src/host/room-participant.js:66rt.deliver(...)sends that text as an ordinary user message into the member's per-room DSH Session, so it is persisted in history.- In a face-to-face room,
routeNoteadds the fixed routing rule (~650 chars: "Default to [PASS] …", "addressed to everyone …", "[PASS] posts nothing …") and a "What members do" list that repeats the roles the face roster already shows, on every routed turn of every Bot asked.
A Bot that spoke 20 times in a group carries 20 copies of the notice and of the fixed instructions.
Measured (main c90af02, mock model, no API)
Harness: core/test/rounds.test.js-style fake DSH, members answering every turn.
| Workload | Persisted turn text | Per turn |
|---|---|---|
| 4-Bot group, 713-char notice, 20 rounds = 80 member turns | 161,750 chars (~40.4k tokens) | ~2,020 chars, of which ~1,440 is fixed text |
| Face room (2 own Bots + 1 friend's Bot), 5 routed plain lines = 15 turns | 25,236 chars | ~1,680 chars, of which ~1,110 is fixed text |
Expected
The rules stay in front of the model on every call and survive a checkpoint / a new part, but are not re-sent and re-stored per turn. The per-turn message carries only what is new (round transcript, speaking order, this line's routing facts) and says briefly when the notice changed.
Fix direction (owner-approved)
Move the members line, @Name calls, notice, admin / lead / member notes, face roster, the routing rule for lines that name no Bot and the reply rule into a system-prompt section of the member's group Session (DSH ctx.systemPrompt.section, the mechanism prompt.js and memory.js already use). DSH renders sections on every model step and re-projects them after compaction, so nothing is lost. The per-turn text keeps the round and a one-line "the group notice changed" hint when the notice differs from what that member saw last.
Why not DSH runtime context (systemPrompt.context): its snapshots are user/messages with source kind runtime-context, which turn-origin.js does not list as a no-request kind, so they would make every group turn other (a turn's origin decides whether a standing approval applies, approvals.js, and what a message_bot / post_to_group from that turn passes on) — a security-surface change. The section route needs none.
Activity
Birfy commentedon Oct 23, 2026
Written-by: Dev
Claimed. Branch
fix/894-room-standing-rules(pushed to the forkBirfy/FlyBot).Keep a group's fixed rules in its standing section, not in every turn (…
Fix mock admin @ALL and in-place compaction in smoke (#917) (#925)