feat: add extend ttl feature protocol (#18)
Prereq for: https://linear.app/warpdotdev/issue/REMOTE-1769/increase-redis-ttl-on-failed-setup This allows redis TTL extensions to be passed via the session sharing protcol.
Daniel Michelin committed
May 26, 2026 at 16:23 UTC
9e437df5be3c318999a9c94dba1826ebb33ad679
1 file changed
+16
src/sharer.rs
+16
@@ -230,6 +230,15 @@ pub enum Lifetime {
230
Lingering,
231
}
232
233
+/// The reasons the sharer may request extended retention for a shared session.
234
+#[derive(Serialize, Deserialize, Clone, Copy, Debug, Default)]
235
+pub enum SessionRetentionReason {
236
+ /// Environment setup failed. The session should remain available so users can inspect setup
237
+ /// command output from the shared session link after the sandbox shuts down.
238
+ #[default]
239
+ SetupFailed,
240
+}
241
+
242
/// The initial state that the sharer must supply when starting
243
/// a shared session.
244
#[derive(Debug, Deserialize, Serialize)]
@@ -499,6 +508,13 @@ pub enum UpstreamMessage {
508
/// and notify viewers before the websocket closes.
509
EndSession { reason: SessionEndedReason },
510
511
+ /// The client sends this message to request that the server retain session data longer than
512
+ /// normal after sharing ends.
513
+ ExtendSessionRetention {
514
+ #[serde(default)]
515
+ reason: SessionRetentionReason,
516
+ },
517
+
518
/// Update to the sharer's active prompt.
519
UpdateActivePrompt(ActivePromptUpdate),
520