Skip to content

feat: session-aware architecture with HTTP transport#2

Open
rahulrajaram wants to merge 1 commit into
masterfrom
feat/session-aware-architecture
Open

feat: session-aware architecture with HTTP transport#2
rahulrajaram wants to merge 1 commit into
masterfrom
feat/session-aware-architecture

Conversation

@rahulrajaram

Copy link
Copy Markdown
Owner

Summary

  • Replace in-memory agent identity (_agentName) with Redis-backed session records, enabling cross-process reconnection and durable mailboxes
  • Add native HTTP transport via StreamableHTTPServerTransport, eliminating the need for stdio bridges like supergateway
  • Extract MailboxStore and SessionStore from RedisClient into src/core/
  • Add close_session tool (preserves mailbox) alongside destructive unregister_agent
  • Replace PTY wrapper LLEN polling with Redis keyspace notifications (with polling fallback)
  • Add vitest test suite (23 tests across 6 files) and CI test job with Redis service
  • Enable noUncheckedIndexedAccess in tsconfig for stricter type safety

Test plan

  • 23 integration tests pass locally against Redis
  • Tests cover: session lifecycle, cross-process reconnection, tool contracts, multi-session presence, HTTP transport round-trip
  • CI build + lint + typecheck passes on Node 20 and 22
  • CI test job passes with Redis service container

Replace in-memory agent identity (_agentName) with Redis-backed session
records so identity survives process boundaries. Agents receive a
session_id on registration and pass it to session-scoped tools, enabling
cross-process reconnection for stateless and bridge-based transports.

Also adds a native HTTP transport so bridges like supergateway are no
longer needed.

- Extract MailboxStore and SessionStore from RedisClient into src/core/
- Add TTL-based session leases for presence detection
- Return session_id from register_agent
- Accept optional session_id on send_message, receive_message,
  close_session, and unregister_agent via ensureSessionBinding helper
- Add close_session tool (preserves mailbox) alongside destructive
  unregister_agent
- Add native HTTP transport via StreamableHTTPServerTransport
- Replace PTY wrapper polling with Redis keyspace notifications
- Add vitest test suite (24 tests) and CI test job
- Enable noUncheckedIndexedAccess in tsconfig
@rahulrajaram
rahulrajaram force-pushed the feat/session-aware-architecture branch from 23f84e3 to 22ca428 Compare April 16, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant