Add session IDs, forking, ephemeral sessions and auto-resume #933
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 422 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.362
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #933"
general
weight: 0.35
samuelcolvin
A relay that stores sessions names each one in
ChildEvent.session_id, set on its first reply toConfigureorLoadwhatever that reply's kind, so a load of a suspended session still carries it.Configure.persistenceasks the relay to store a session or not, andLoad.forkcopies a stored session under a new ID instead of claiming it. Children ignore all three, soPROTOCOL_VERSIONdoes not move.monty-pool exposes
Persistence,ReplConfig::persistence,Checkout::session_idandrestore(.., fork, ..). WithPoolConfig::auto_resume(default on) a checkout whose relay drains a named session redials, reclaims it by ID and re-sends the request the relay did not run, returning the originalShutdownif the reclaimed session does not match.pydantic_monty adds
checkout(ephemeral=),AsyncMontyWebsocket(auto_resume=),fork=on the async loads andAsyncMontySession.session_id.Claude-Session: https://claude.ai/code/session_015K5gKCYXr4yxxoKyb6fC19
<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Adds session IDs, forking, ephemeral sessions, and auto-resume for relays that store sessions.
Session storage
ChildEvent.session_idand honorConfigure.persistence; loading an ID always starts a fresh session under a new ID, so forking isDumpthen twoLoads. Children ignore all three, soPROTOCOL_VERSIONstays at 5; a relay without a store refusesDump/LoadwithErrorand names nothing on shutdown.monty-poolexposesPersistence,ReplConfig::persistence, andCheckout::session_id. WithPoolConfig::auto_resume(default on) a checkout whose relay answers withShutdownredials, loads the named state into a new session, re-announces the same suspension, and re-sends the request the relay didn't run, returning the originalShutdownif nothing was named or the reload fails. The resumed session keeps its own budget — only the suspension and sleep totals reset for the re-announcement — and takes its ID from theLoadreply. The turn hot path stays a single async layer with the resume as a boxed tail branch and an untouched result, so auto-resume adds no per-turn cost.pydantic_montyaddscheckout(ephemeral=),AsyncMontyWebsocket(auto_resume=), andAsyncMontySession.session_id, reported even when adopted mid-turn;monty.pool.session.resumedrecords each attempt's outcome.Loadthe worker refuses withErrorkeeps the session's prior ID so its parked state stays resumable; an over-budget aborted re-announcement keeps the new session's ID instead.<sup>Written for commit 966086d76e3b158aece6ae69f2997da8334db570. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/pydantic/monty/pull/933?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->