Skip to content

Gateway hub: text adapters on SessionManager + serve as interactive adapter (from #114 items 2–3) #144

Description

@Moikapy

Summary

Part of #113. Promoted from #114 items 2 and 3 now that #136 (P1, #134) put serve's run queue on SessionManager. This is the next step of decision wiki/decisions/0001-gateway-as-hub.md: the gateway owns sessions, queues and policy (Hermes-style), and every surface connects through it as an adapter.

Why now

  • Future: deferred architecture work & revisit triggers (from #113) #114 item 3's revisit trigger is met: serve's session/run code runs on SessionManager (src/serve/prompts.ts, src/session/manager.ts).
  • Lich now has two session-queue implementations: the gateway's src/gateway/bus.ts and serve's SessionManager. That is the drift 0001 was meant to prevent.
  • Ossuary sends every session over one WebSocket, and serve serializes frames per connection until each prompt.submit finishes, so Ossuary sessions still queue behind each other despite feat: event envelope + SessionManager (P1 / #134) #136. (Found by code reading on main@4718fb4; not yet reproduced.)

Scope

A. Text adapters on the gateway core (#114 item 2)

B. Serve as the interactive adapter (#114 item 3)

Out of scope

Open question

Gateway persistence (history survives a restart) and per-chat profiles were the other half of item 2's trigger. Decide whether they're in A or a follow-up.

References


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture, layering, and module boundariesenhancementNew feature or requestservelich serve JSON-RPC / WS track

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions