@@ -1058,6 +1058,7 @@ type ShellThreadRow = {
10581058 readonly latest_run_requested_at : string | null ;
10591059 readonly latest_run_started_at : string | null ;
10601060 readonly latest_run_completed_at : string | null ;
1061+ readonly latest_run_stop_requested : number ;
10611062 readonly active_run_id : string | null ;
10621063 readonly active_run_status : string | null ;
10631064 readonly activity_run_status : string | null ;
@@ -1068,6 +1069,7 @@ type ShellThreadRow = {
10681069 readonly blocking_run_requested_at : string | null ;
10691070 readonly blocking_run_started_at : string | null ;
10701071 readonly blocking_run_completed_at : string | null ;
1072+ readonly blocking_run_stop_requested : number ;
10711073 readonly blocking_failure_payload_json : string | null ;
10721074 readonly pending_request_payload_json : string | null ;
10731075 readonly pending_secret_request_payload_json : string | null ;
@@ -1598,6 +1600,11 @@ export function threadShellFromProjection(
15981600 latestRunRequestedAt : latestRun ?. requestedAt ?? null ,
15991601 latestRunStartedAt : latestRun ?. startedAt ?? null ,
16001602 latestRunCompletedAt : latestRun ?. completedAt ?? null ,
1603+ latestRunStopRequested :
1604+ latestRun != null &&
1605+ projection . turnItems . some (
1606+ ( item ) => item . runId === latestRun . id && item . type === "run_interrupt_request" ,
1607+ ) ,
16011608 activeRunId : activeRun ?. id ?? null ,
16021609 blockedOnThreadWait : deriveBlockedOnThreadWait ( { activeRun, turnItems : projection . turnItems } ) ,
16031610 activityRunStatus : activityRun ?. status ?? null ,
@@ -1697,6 +1704,7 @@ type ShellThreadState = {
16971704 readonly latestRunRequestedAt : DateTime . Utc | null ;
16981705 readonly latestRunStartedAt : DateTime . Utc | null ;
16991706 readonly latestRunCompletedAt : DateTime . Utc | null ;
1707+ readonly latestRunStopRequested : boolean ;
17001708 readonly activeRunId : RunId | null ;
17011709 readonly blockedOnThreadWait : boolean ;
17021710 readonly activityRunStatus : ShellActivityRunStatus | null ;
@@ -1850,6 +1858,7 @@ function shellFromState(input: {
18501858 latestRunRequestedAt : input . state . latestRunRequestedAt ,
18511859 latestRunStartedAt : input . state . latestRunStartedAt ,
18521860 latestRunCompletedAt : input . state . latestRunCompletedAt ,
1861+ latestRunStopRequested : input . state . latestRunStopRequested ,
18531862 activeRunId : input . state . activeRunId ,
18541863 blockedOnThreadWait : input . state . blockedOnThreadWait ,
18551864 activityRunStatus : input . state . activityRunStatus ,
@@ -5638,6 +5647,11 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
56385647 presented.requested_at AS latest_run_requested_at,
56395648 json_extract(presented.payload_json, '$.startedAt') AS latest_run_started_at,
56405649 presented.completed_at AS latest_run_completed_at,
5650+ EXISTS (
5651+ SELECT 1 FROM orchestration_v2_projection_turn_items stop_request
5652+ WHERE stop_request.thread_id = t.thread_id AND stop_request.run_id = presented.run_id
5653+ AND stop_request.type = 'run_interrupt_request'
5654+ ) AS latest_run_stop_requested,
56415655 active.run_id AS active_run_id,
56425656 active.status AS active_run_status,
56435657 (
@@ -5688,6 +5702,11 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
56885702 blocked.requested_at AS blocking_run_requested_at,
56895703 json_extract(blocked.payload_json, '$.startedAt') AS blocking_run_started_at,
56905704 blocked.completed_at AS blocking_run_completed_at,
5705+ EXISTS (
5706+ SELECT 1 FROM orchestration_v2_projection_turn_items stop_request
5707+ WHERE stop_request.thread_id = t.thread_id AND stop_request.run_id = blocked.run_id
5708+ AND stop_request.type = 'run_interrupt_request'
5709+ ) AS blocking_run_stop_requested,
56915710 (
56925711 SELECT item.payload_json
56935712 FROM orchestration_v2_projection_turn_items item
@@ -6160,6 +6179,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
61606179 row . latest_run_completed_at === null
61616180 ? null
61626181 : DateTime . makeUnsafe ( row . latest_run_completed_at ) ;
6182+ let latestRunStopRequested = row . latest_run_stop_requested === 1 ;
61636183 if ( row . blocking_run_id !== null && row . blocking_failure_payload_json !== null ) {
61646184 const blockingFailure = yield * decodeTurnItemPayload (
61656185 row . blocking_failure_payload_json ,
@@ -6172,6 +6192,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
61726192 if ( blocksQueue && blockingFailure !== null ) {
61736193 terminalFailureItem = blockingFailure ;
61746194 latestRunId = RunId . make ( row . blocking_run_id ) ;
6195+ latestRunStopRequested = row . blocking_run_stop_requested === 1 ;
61756196 latestRunStatus = "failed" ;
61766197 latestRunRequestedAt =
61776198 row . blocking_run_requested_at === null
@@ -6211,6 +6232,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
62116232 latestRunRequestedAt,
62126233 latestRunStartedAt,
62136234 latestRunCompletedAt,
6235+ latestRunStopRequested,
62146236 activeRunId : row . active_run_id === null ? null : RunId . make ( row . active_run_id ) ,
62156237 blockedOnThreadWait : deriveBlockedOnThreadWait ( {
62166238 activeRun :
0 commit comments