Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(claude): guard completed agent resumes #9130

ClosedPlunderStruck(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/9130/headopened View on GitHub

Showing 12 changed files with 53 additions and 0 deletions (loading 11).

x
0 of 12 viewed, 12 left
53 additions and 0 deletionsapps/server/src/persistence/ProviderSessionRuntime.tsModified
View file
@@ -58,6 +58,15 @@
export const DeleteProviderSessionRuntimeInput = Schema.Struct({ threadId: ThreadId });
export type DeleteProviderSessionRuntimeInput = typeof DeleteProviderSessionRuntimeInput.Type;
​
+export const UpdateProviderSessionRuntimeResumeCursorInput = Schema.Struct({
+ threadId: ThreadId,
+ providerInstanceId: ProviderInstanceId,
+ lastSeenAt: IsoDateTime,
+ resumeCursor: Schema.Unknown,
+});
+export type UpdateProviderSessionRuntimeResumeCursorInput =
+ typeof UpdateProviderSessionRuntimeResumeCursorInput.Type;
+​
/**
* ProviderSessionRuntimeRepository - Service tag for provider runtime persistence.
*/
@@ -83,6 +92,15 @@
ProviderSessionRuntimeRepositoryError
>;
​
+ /**
+ * Update a cursor only while the named provider instance still owns the row.
+ *
+ * Returns false when the session was removed or rebound before the update.
+ */
+ readonly updateResumeCursorIfCurrentInstance: (
+ input: UpdateProviderSessionRuntimeResumeCursorInput,
+ ) => Effect.Effect<boolean, ProviderSessionRuntimeRepositoryError>;
+​