@@ -104,6 +104,7 @@ import {
104104 selectHistoryPageFromCursor ,
105105 selectRecentTimelineWindow ,
106106 THREAD_HISTORY_PAGE_POLICY ,
107+ THREAD_HISTORY_INLINE_WORK_ITEM_LIMIT ,
107108 THREAD_HISTORY_TURN_SNAPSHOT_ROW_LIMIT ,
108109} from "./threadHistoryPaging.ts" ;
109110
@@ -420,7 +421,6 @@ export interface ProjectionStoreV2Shape {
420421 throughEntryId ?: string ,
421422 conversationOnly ?: boolean ,
422423 workMode ?: "deferred" | "work" ,
423- inlineWorkItemLimit ?: number ,
424424 ) => Effect . Effect < OrchestrationV2ThreadHistoryPage , ProjectionStoreV2Error > ;
425425 readonly getTimelinePage : (
426426 threadId : ThreadId ,
@@ -617,7 +617,6 @@ export interface ProjectionStoreV2Shape {
617617 readonly rowLimit : number ;
618618 readonly userTurnLimit ?: number | undefined ;
619619 readonly deferWork ?: boolean | undefined ;
620- readonly inlineWorkItemLimit ?: number | undefined ;
621620 readonly anchorItemId ?: TurnItemId | undefined ;
622621 readonly anchorThreadId ?: ThreadId | undefined ;
623622 readonly requiredRunId ?: RunId | undefined ;
@@ -2869,7 +2868,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
28692868 SELECT run_id, segment, attempt_id, MIN(ordinal) AS first_ordinal,
28702869 MAX(ordinal) AS last_ordinal, COUNT(*) AS item_count
28712870 FROM work_segments WHERE can_defer = 1
2872- GROUP BY run_id, segment, attempt_id HAVING COUNT(*) > ${ window . inlineWorkItemLimit ?? THREAD_HISTORY_PAGE_POLICY . maxItems }
2871+ GROUP BY run_id, segment, attempt_id HAVING COUNT(*) > ${ THREAD_HISTORY_INLINE_WORK_ITEM_LIMIT }
28732872 ), window_items AS NOT MATERIALIZED (
28742873 SELECT item_rowid, ordinal, turn_item_id, run_id, type
28752874 FROM eligible WHERE ${ window . deferWork ? 1 : 0 } = 0
@@ -3652,7 +3651,6 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
36523651 rowLimit : window . rowLimit ,
36533652 userTurnLimit : window . userTurnLimit ,
36543653 deferWork : window . deferWork ,
3655- inlineWorkItemLimit : window . inlineWorkItemLimit ,
36563654 requiredRunId : forkedFrom . runId ,
36573655 suppressLocal : anchor === undefined || anchorIsInDescendant ,
36583656 ...( anchor === undefined || anchorIsInDescendant
@@ -5454,7 +5452,6 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
54545452 throughEntryId ,
54555453 conversationOnly ,
54565454 workMode ,
5457- inlineWorkItemLimit ,
54585455 ) =>
54595456 sql
54605457 . withTransaction (
@@ -5473,10 +5470,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
54735470 position,
54745471 canonicalPosition : position ,
54755472 } ) ) ;
5476- const historyItems =
5477- workMode === "deferred"
5478- ? deferWorkHistoryRows ( indexed , inlineWorkItemLimit )
5479- : indexed ;
5473+ const historyItems = workMode === "deferred" ? deferWorkHistoryRows ( indexed ) : indexed ;
54805474 const selection = yield * Effect . try ( {
54815475 try : ( ) => {
54825476 const policy = olderHistoryPagePolicy ( { items : indexed , cursor, throughEntryId } ) ;
@@ -5665,7 +5659,6 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
56655659 rowLimit : options . rowLimit ,
56665660 userTurnLimit : options . userTurnLimit ,
56675661 deferWork : options . deferWork ,
5668- inlineWorkItemLimit : options . inlineWorkItemLimit ,
56695662 ...( historyAnchor ?. threadId === threadId
56705663 ? { anchorItemId : historyAnchor . itemId }
56715664 : { } ) ,
0 commit comments