Skip to content

feat(bot-mode): Group Chats survive Desktop closing — gateway-owned authority and replay (salvage #97712) - #99007

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-5099e5c2
Aug 31, 2026
Merged

feat(bot-mode): Group Chats survive Desktop closing — gateway-owned authority and replay (salvage #97712)#99007
teknium1 merged 2 commits into
mainfrom
hermes/hermes-5099e5c2

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Group Chats gain a durable, gateway-owned authority and ordered replay log in root state.db, so a room no longer depends on the Desktop process that created it — salvage of #97712 by @dokterdok, plus the UTF-8 replay-bound blocker fix and authority lineage on replay pages per the decision on #97681.

Changes

  • gateway/hosted_rooms.py: durable room store — identity, membership, ordered events, server-issued authority (authority_gateway_id + monotonic authority_epoch), idempotent appends, stale-writer fencing, retired-ID reservations, byte-bounded replay pages (@dokterdok, salvaged commit)
  • tui_gateway/methods_groups.py + methods_bot_relay.py: inert groups.* RPC surface (capabilities/list/create/state/send/log/disband); driver stays off in this slice
  • hermes_cli/install_identity.py: stable install identity with cross-process/corrupt-file-safe creation (POSIX + Windows)
  • Follow-up (ours): read_events() pages now carry the room's authority stamp (authority.gateway_id/authority.epoch) so replicating participants persist lineage with every page — groundwork for the log-replication + epoch-takeover requirement from Bot Group Chats should keep working after Desktop closes #97681
  • Follow-up (ours): regression test pinning that the replay page bound counts UTF-8 bytes, not characters (Axl's blocker 1); sabotage-verified — restoring LENGTH(TEXT) accounting fails the new test while the pre-existing multibyte test passed under it

Validation

Check Result
Hosted-room + groups + install-identity suites 56 passed
New byte-vs-char bound test, sabotage run fails under char accounting, passes fixed
E2E (real imports, temp HERMES_HOME, real install identity) multibyte replay bounded, authority stamp present, foreign-authority append rejected
Ruff on changed files clean
Stale-base gate 0 commits behind origin/main

Blockers 2–4 from the exact-head review (#97797 reauth, #97846 code-4123 replay, #98072 attachment lineage) are owned by their layers and will be fixed in those salvages.

Infographic

Durable Group Chat authority and replay

dokterdok and others added 2 commits August 30, 2026 18:38
…d replay

Follow-ups on top of the salvaged #97712 foundation:

- read_events() pages now include the room's authority stamp
  (authority.gateway_id + authority.epoch), so a replicating participant
  can persist lineage with every page and a future takeover layer can
  fence stale authorities from replayed state alone.
- New regression test proves the replay page bound counts UTF-8 BYTES,
  not characters: sabotaging LENGTH(CAST(.. AS BLOB)) back to
  LENGTH(TEXT) and dropping the .encode('utf-8') guard fails the test;
  the pre-existing multibyte test passed under that sabotage.
- _raise_room_not_found typed NoReturn so narrowing survives closures.
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on dfcea47 — feat(bot-mode): replay pages carry authority lineage; pin by

⚠️ Warnings

OSV vulnerability scan · View job

6 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 4m18s vs 3m37s (+18.9%). 7 job(s) slower, 4 faster, 1 unchanged.

  • Python tests / Run tests: +43.0s
  • OS-specific tests / Windows-only tests: -11.0s
  • OSV scan / Scan lockfiles / osv-scan: +5.0s
  • Python lints / ruff enforcement (blocking): +3.0s
  • OS-specific tests / macOS-only tests: +3.0s

@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Aug 31, 2026
@teknium1
teknium1 merged commit cc4b5ba into main Aug 31, 2026
38 checks passed
@teknium1
teknium1 deleted the hermes/hermes-5099e5c2 branch August 31, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants