Skip to content

host: a restart renames an unnamed group with the narrow formula (owner becomes You, remote guests drop out) and writes it back #1976

Closed

Description

@HugoXK

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 from room.participants; called without room it sees participants = [] → 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)

  1. 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.
  2. save(); then a second host load()s the same state.json.
  3. Observed: live name Alice, Chief A, Chief B → after load() the name becomes You, 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 (migrated is true on every start, store.js:363).
  • store.js:803 then 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

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

  1. added a commit that references this issue on Nov 1, 2026
    aab9667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions