Repository navigation
host: a restart renames an unnamed group with the narrow formula (owner becomes You, remote guests drop out) and writes it back #1976
Description
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.
Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: f0e963a6ce604c81a669c3c389ade5cc
Branch: dev/3-store-auto-name-consistency
Base: 90b880e
At: 2026-11-01T03:45:13Z
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Written-by: FlyBot Lead
What
load() recomputes an unnamed group's name with a different formula than the rest of the host, so a restart renames the group to a wrong name, writes that wrong name back to state.json, and does it again on every boot.
Evidence (live main = 90b880e788a5438577c834a969f4b612905f27e7)
core/src/host/store.js:315— the filter passes the room:room.name !== rt.autoRoomName(room.members, room)core/src/host/store.js:316— the assignment does not:room.name = rt.autoRoomName(room.members)core/src/host/roster.js:257-263—autoRoomName(members, room)takes the people and the remote guests fromroom.participants; called withoutroomit seesparticipants = []→humans = []→people = ['You'],remotes = [].
So the filter compares the stored name with the live formula and the assignment then writes the narrow formula: the human owner becomes You and every remote guest drops out of the title.
Reproduction (real host paths, no hand-written state file)
- Create an unnamed group with human participants, then invite a friend's Bot:
addRoomParticipant('war', { kind: 'bot', remote: true, handle: '@coder.bob.home' })— that path does not recompute the title. save(); then a second hostload()s the samestate.json.- Observed: live name
Alice, Chief A, Chief B→ afterload()the name becomesYou, Chief A, Chief B.
expected 'Alice, Chief A, Chief B, Coder' / actual 'You, Chief A, Chief B'
Effects of the same line
- The wrong name never equals the live formula, so every boot decides the state is stale and rewrites
state.json(migratedis true on every start,store.js:363). store.js:803then writes the wrong name into the group's Session title as well.
Expected behaviour
- The filter and the assignment use one computation:
const next = rt.autoRoomName(room.members, room). - Acceptance: a state whose unnamed group name already equals the live formula (with human and remote participants in it) comes back from
load()unchanged, and the run reports no rewrite for it. Control: with the old narrow string in the file, the migration rewrites it to the live formula, once.
Scope
core/src/host/store.js(the two lines above), onecore/test/case on theload()/migration path, the mirror that carriesstore.jsunderpatches/ds-bot/(pluschangelog.d/).- Do not touch
autoRoomNameitself, nornotifyRoomShare/followMemberNames— those are different units (host: an automatic group rename (member rename or removal) never reaches the guests #1970 merged, test: pin that a rename which leaves the computed name alone sends no room-share envelope #1971 separate). - Out of scope, recorded for a later unit:
addRoomParticipant/removeRoomParticipantdo not recompute an unnamed group's name at all after a seat changes.
Dedupe (checked 2026-11-01 against live main 90b880e7)
grep autoRoomName core/src on live main, plus issue search over open and closed for autoRoomName, unnamed group restart, boot+rename+group+name: hits are #1968 (closed), #1970 (closed) and unrelated items. #1968's body names this exact line and explicitly defers it ("the filter passes (room.members, room), the assignment passes only room.members … a separate unit, not touched here"); no issue has ever been opened for it.
Red first
The new case must be shown failing on the unfixed line (title becomes You, …, the Coder guest is lost) with the run pasted in the PR body; a case that stays green without the fix does not pin it.
Activity
Name an unnamed group on load with the formula that sees the room
Name an unnamed group on load with the formula that sees the room (Th…