| ... | @@ -338,7 +338,6 @@ interface OpenCodeSessionContext { | ... | @@ -338,7 +338,6 @@ interface OpenCodeSessionContext { |
| 338 | readonly partById: Map<string, Part>; | 338 | readonly partById: Map<string, Part>; |
| 339 | readonly emittedTextByPartId: Map<string, string>; | 339 | readonly emittedTextByPartId: Map<string, string>; |
| 340 | readonly completedAssistantPartIds: Set<string>; | 340 | readonly completedAssistantPartIds: Set<string>; |
| 341 | readonly turns: Array<OpenCodeTurnSnapshot>; | | |
| 342 | activeTurnId: TurnId | undefined; | 341 | activeTurnId: TurnId | undefined; |
| 343 | activeAgent: string | undefined; | 342 | activeAgent: string | undefined; |
| 344 | activeVariant: string | undefined; | 343 | activeVariant: string | undefined; |
| ... | @@ -476,31 +475,6 @@ function mapPermissionDecision(reply: "once" | "always" | "reject"): string { | ... | @@ -476,31 +475,6 @@ function mapPermissionDecision(reply: "once" | "always" | "reject"): string { |
| 476 | } | 475 | } |
| 477 | } | 476 | } |
| 478 | | 477 | |
| 479 | function resolveTurnSnapshot( | | |
| 480 | context: OpenCodeSessionContext, | | |
| 481 | turnId: TurnId, | | |
| 482 | ): OpenCodeTurnSnapshot { | | |
| 483 | const existing = context.turns.find((turn) => turn.id === turnId); | | |
| 484 | if (existing) { | | |
| 485 | return existing; | | |
| 486 | } | | |
| 487 | | | |
| 488 | const created: OpenCodeTurnSnapshot = { id: turnId, items: [] }; | | |
| 489 | context.turns.push(created); | | |
| 490 | return created; | | |
| 491 | } | | |
| 492 | | | |
| 493 | function appendTurnItem( | | |
| 494 | context: OpenCodeSessionContext, | | |
| 495 | turnId: TurnId | undefined, | | |
| 496 | item: unknown, | | |
| 497 | ): void { | | |
| 498 | if (!turnId) { | | |
| 499 | return; | | |
| 500 | } | | |
| 501 | resolveTurnSnapshot(context, turnId).items.push(item); | | |
| 502 | } | | |
| 503 | | | |
| 504 | const ensureSessionContext = Effect.fn("ensureSessionContext")(function* ( | 478 | const ensureSessionContext = Effect.fn("ensureSessionContext")(function* ( |
| 505 | sessions: ReadonlyMap<ThreadId, OpenCodeSessionContext>, | 479 | sessions: ReadonlyMap<ThreadId, OpenCodeSessionContext>, |
| 506 | threadId: ThreadId, | 480 | threadId: ThreadId, |
| ... | @@ -2365,7 +2339,6 @@ export function makeOpenCodeAdapter( | ... | @@ -2365,7 +2339,6 @@ export function makeOpenCodeAdapter( |
| 2365 | : "item.updated", | 2339 | : "item.updated", |
| 2366 | payload, | 2340 | payload, |
| 2367 | }; | 2341 | }; |
| 2368 | appendTurnItem(context, turnId, part); | | |
| 2369 | yield* emit(runtimeEvent); | 2342 | yield* emit(runtimeEvent); |
| 2370 | } | 2343 | } |
| 2371 | break; | 2344 | break; |
| ... | @@ -2853,7 +2826,6 @@ export function makeOpenCodeAdapter( | ... | @@ -2853,7 +2826,6 @@ export function makeOpenCodeAdapter( |
| 2853 | emittedTextByPartId: new Map(), | 2826 | emittedTextByPartId: new Map(), |
| 2854 | messageRoleById: new Map(), | 2827 | messageRoleById: new Map(), |
| 2855 | completedAssistantPartIds: new Set(), | 2828 | completedAssistantPartIds: new Set(), |
| 2856 | turns: [], | | |
| 2857 | activeTurnId: undefined, | 2829 | activeTurnId: undefined, |
| 2858 | activeAgent: undefined, | 2830 | activeAgent: undefined, |
| 2859 | activeVariant: undefined, | 2831 | activeVariant: undefined, |