Skip to content

feat: add restored session manager support and harden SSE startup#222

Open
0xCaso wants to merge 6 commits intowevm:mainfrom
0xCaso:session-manager-restore
Open

feat: add restored session manager support and harden SSE startup#222
0xCaso wants to merge 6 commits intowevm:mainfrom
0xCaso:session-manager-restore

Conversation

@0xCaso
Copy link
Copy Markdown

@0xCaso 0xCaso commented Mar 24, 2026

Summary

  • add SessionManager restore support so callers can resume Tempo session state across process restarts
  • export the Tempo client entrypoint and harden SSE startup by preserving Headers instances and failing fast on non-OK SSE responses
  • keep restored close behavior consistent by clearing opened state after a successful close

Motivation

  • OpenCode-style clients restart frequently, but still need to continue using existing Tempo session channels
  • without restore support, callers can only rely on in-memory session state and lose continuity after process restart
  • the SSE hardening changes make restored and fresh session flows fail more predictably when the upstream does not actually return a valid stream

Test Plan

  • VITE_NODE_ENV=testnet pnpm test --project node src/tempo/client/SessionManager.test.ts src/tempo/client/Session.test.ts
  • pnpm run check:types<

PS: i left the docs file just for reference

@0xCaso 0xCaso changed the title feat: add session manager restore feat: add restored session manager support and harden SSE startup Mar 24, 2026
@0xCaso 0xCaso force-pushed the session-manager-restore branch from 1541926 to a3c0953 Compare March 24, 2026 13:58
@0xCaso 0xCaso force-pushed the session-manager-restore branch from a3c0953 to 9ea4a12 Compare March 25, 2026 08:39
@brendanjryan
Copy link
Copy Markdown
Collaborator

Thanks for submitting!

We are going to try to lessen client state even more, and are pursing a similar design over here: #260

My preference is to continue down the path outlined in ^, but would love your thoughts / feedback 🙇

@0xCaso
Copy link
Copy Markdown
Author

0xCaso commented Apr 1, 2026

@brendanjryan oh yeah sure that makes sense!

stateless resume would be convenient, also about "hints" --> this means that servers must emit those hints otherwise a new session is created?

e.g. if I'm using tempo's OpenAI/Anthropic proxies to use mpp inside opencode (example of plugin), those ones should emit the hints?

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.

2 participants