Skip to content

Group turns re-send and store the group notice and fixed room rules on every turn #894

Closed

Description

@Birfy

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.js roomPrompt (~line 244-273 on c90af02) 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), and ROOM_REPLY, plus the round (transcript, speaking order).
  • core/src/host/room-participant.js:66 rt.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, routeNote adds 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

  1. added
    bugSomething isn't working
    area:automationScheduled tasks and automation
    on Oct 23, 2026
  2. self-assigned this
    on Oct 23, 2026
  3. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 23, 2026
  4. Birfy commented on Oct 23, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Claimed. Branch fix/894-room-standing-rules (pushed to the fork Birfy/FlyBot).

  5. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 23, 2026
  6. added a commit that references this issue on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions