Skip to content
Source
Sign inSign up
pingdotgg/t3code

Show provider usage-limit stops in the UI instead of failing silently #5077

ClosedZeus-Deus(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/5077/headopened View on GitHub

Showing 28 changed files with 17 additions and 1 deletion (loading 25).

x
0 of 28 viewed, 28 left
1 addition and 0 deletionsapps/server/src/orchestration/Layers/ProjectionPipeline.tsModified
View file
@@ -1081,6 +1081,7 @@
runtimeMode: event.payload.session.runtimeMode,
activeTurnId: event.payload.session.activeTurnId,
lastError: event.payload.session.lastError,
+ usageLimit: event.payload.session.usageLimit ?? null,
Thread on line 1084

Durable turns ignore usage-limit settle

Medium Severity

applyThreadTurnsProjection still settles leaving-running turns only from session status, so a usage-limit stop (ready + usageLimit) is persisted as completed. The in-memory projector and client reducer already map that case to interrupted, so after a reload from the projection store the turn looks like a clean finish again.

Additional Locations (2)
Fix in Cursor Fix in Web
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit fe7d85add8107285aa7d4b7aa3eae9f9f5b1fc3c. Configure [here](https://www.cursor.com/dashboard/bugbot).
updatedAt: event.payload.session.updatedAt,
13 additions and 1 deletionapps/server/src/orchestration/Layers/ProjectionSnapshotQuery.tsModified
View file
@@ -5,6 +5,7 @@
MessageId,
NonNegativeInt,
OrchestrationCheckpointFile,
+ OrchestrationSessionUsageLimit,
OrchestrationProposedPlanId,
OrchestrationReadModel,
OrchestrationThreadSearchSource,
@@ -87,7 +88,12 @@
sequence: Schema.NullOr(NonNegativeInt),
}),
);
-const ProjectionThreadSessionDbRowSchema = ProjectionThreadSession;
+// `usage_limit` is a nullable JSON text column.
+const ProjectionThreadSessionDbRowSchema = ProjectionThreadSession.mapFields(
+ Struct.assign({