Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep provider sessions alive during background agent work #4199

ClosedChamaruAmasara(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/4199/headopened View on GitHub

Showing 8 changed files with 43 additions and 0 deletions (loading 5).

x
0 of 8 viewed, 8 left
41 additions and 0 deletionsapps/server/src/persistence/ProviderSessionRuntime.tsModified
View file
@@ -58,6 +58,12 @@
export const DeleteProviderSessionRuntimeInput = Schema.Struct({ threadId: ThreadId });
export type DeleteProviderSessionRuntimeInput = typeof DeleteProviderSessionRuntimeInput.Type;
​
+export const TouchLastSeenInput = Schema.Struct({
+ threadId: ThreadId,
+ lastSeenAt: IsoDateTime,
+});
+export type TouchLastSeenInput = typeof TouchLastSeenInput.Type;
+​
/**
* ProviderSessionRuntimeRepository - Service tag for provider runtime persistence.
*/
@@ -93,6 +99,18 @@
ProviderSessionRuntimeRepositoryError
​
+ /**
+ * Bump only `last_seen_at` for an existing, non-stopped row.
+ *
+ * A targeted update used to keep a session's inactivity clock fresh from
+ * background runtime activity (e.g. a running dynamic workflow) without
+ * rewriting the full runtime payload. Rows in `stopped` status are left
+ * untouched so a reaped session is never resurrected.
+ */
+ readonly touchLastSeen: (
+ input: TouchLastSeenInput,
+ ) => Effect.Effect<void, ProviderSessionRuntimeRepositoryError>;
+​