Skip to content

feat(bot-mode): keep Group Chat files durable on gateways - #96760

Closed
dokterdok wants to merge 13 commits into
NousResearch:mainfrom
dokterdok:feat/group-chat-attachment-runtime-20260828
Closed

dokterdok wants to merge 13 commits into
NousResearch:mainfrom
dokterdok:feat/group-chat-attachment-runtime-20260828

Conversation

@dokterdok

Copy link
Copy Markdown
Contributor

The user problem

Bot Group Chats can already discuss text after Desktop closes, but a shared
file does not yet have the same continuity. A screenshot, PDF, spreadsheet, or
document needs to remain available to the Bots that were in the chat when it
was sent, survive a gateway restart, and never leak a host path into history.

This is the durable gateway layer for that experience.

Important

This draft is stacked on #96654. Review a00706b742..57962642d7: one
commit defines the private attachment ledger and bounded task contract; the
second stages those files atomically into same-gateway Bot turns.

What it enables

When a file is shared with a gateway-hosted Group Chat:

  1. Hermes stores the bytes privately on the Group Chat's gateway.
  2. The room log keeps only an opaque ID and safe metadata.
  3. Each Bot that belonged to the chat at send time receives the verified file
    through the same image, PDF, and file tools used by one-to-one chats.
  4. The bytes and recipient snapshot survive restart and replay.

The result is simple from the user's perspective: files stay with the Group
Chat and the intended Bots can keep working with them after Desktop closes.

Safety and reliability

  • Images and PDFs must match their declared content. Other file types remain
    opaque, so DOCX, XLSX, PPTX, EPUB, JAR, APK, and similar ZIP containers keep
    working.
  • One message accepts up to 8 files, 15MB each, and 25MB total.
  • One Bot task stages at most 16 files and 50MB. Larger backlogs advance in
    deterministic batches instead of retrying the same oversized task forever.
  • Staging is attempt-scoped. If the second file fails, the first is rolled back
    and cannot leak into the next unrelated turn.
  • Generic files created by a failed attempt are removed; pre-existing files are
    preserved.
  • A late-added Bot does not gain access to historical files.
  • Gateway and room quotas, abandoned-upload expiry, disband grace, SHA-256
    verification, private permissions, and symlink rejection are enforced.
  • Room events contain no bytes, data URLs, local paths, or per-Bot transport
    references.

Review boundaries

  • Same-gateway Bot delivery only in this draft.
  • Desktop picker, paste, drag/drop, messaging ingestion, history rendering, and
    classic Desktop-driven Group Chats are the stacked surface follow-up.
  • Cross-gateway RoomLink byte transfer is a separate increment with its own
    grants, receipts, and failure matrix.
  • This does not change feat(desktop): group-chat attachment chips open in the file manager #89758's attachment-chip interaction.

Validation

Focused exact-stack validation:

Check Result
Combined gateway/runtime attachment suite included in 242 passing Python tests
Atomic staging rollback tests passed
200-file backlog stress test 13 bounded, lossless batches
DOCX/XLSX/PPTX/EPUB/JAR/APK compatibility cases passed
Ruff passed
git diff --check passed

The parent and child heads remain draft until exact-head live UAT is added.

Related work

Type of change

  • Bug fix
  • New feature
  • Security fix
  • Tests
  • Refactor

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) comp/plugins Plugin system and bundled plugins platform/slack Slack app adapter 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-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data labels Aug 28, 2026
@dokterdok

Copy link
Copy Markdown
Contributor Author

Closing this cumulative prototype now that #97681 captures the user contract, safety boundaries, and phased landing plan against the rebuilt Bot Mode tree. Its useful layer can be re-cut as a narrow current-main contribution after the foundation direction is agreed.

@dokterdok dokterdok closed this Aug 29, 2026
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/desktop Electron desktop app (apps/desktop/*) comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins comp/tui Terminal UI (ui-tui/ + tui_gateway/) needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have platform/slack Slack app adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data 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.

2 participants