Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): skip imports of native agent sessions #10950

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

Showing 10 changed files with 29 additions and 6 deletions (loading 9).

x
0 of 10 viewed, 10 left
29 additions and 6 deletionsapps/server/src/persistence/ProviderSessionRuntime.tsModified
View file
@@ -67,6 +67,7 @@
​
export interface ProviderSessionRuntimeUpsertOptions {
readonly onConflict?: "update" | "ignore";
+ readonly unlessNativeSessionId?: string;
​
/**
@@ -84,7 +85,7 @@
readonly upsert: (
runtime: ProviderSessionRuntime,
options?: ProviderSessionRuntimeUpsertOptions,
- ) => Effect.Effect<void, ProviderSessionRuntimeRepositoryError>;
+ ) => Effect.Effect<boolean, ProviderSessionRuntimeRepositoryError>;
​
/** Record one source file without replacing the current session state. */
readonly recordImportedTranscript: (
@@ -237,8 +238,12 @@
});
​
- const insertRuntimeRow = SqlSchema.void({
- Request: ProviderSessionRuntimeDbRowSchema,
+ // A no-op conflict update lets RETURNING report allowed reuse without changing the binding.
+ const insertRuntimeRow = SqlSchema.findOneOption({
+ Request: ProviderSessionRuntimeDbRowSchema.mapFields(
+ Struct.assign({ unlessNativeSessionId: Schema.NullOr(Schema.String) }),
+ ),