| ... | ... | @@ -338,7 +338,6 @@ interface OpenCodeSessionContext { |
| 338 | 338 | readonly partById: Map<string, Part>; |
| 339 | 339 | readonly emittedTextByPartId: Map<string, string>; |
| 340 | 340 | readonly completedAssistantPartIds: Set<string>; |
| 341 | | readonly turns: Array<OpenCodeTurnSnapshot>; |
| 342 | 341 | activeTurnId: TurnId | undefined; |
| 343 | 342 | activeAgent: string | undefined; |
| 344 | 343 | activeVariant: string | undefined; |
| ... | ... | @@ -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 | 478 | const ensureSessionContext = Effect.fn("ensureSessionContext")(function* ( |
| 505 | 479 | sessions: ReadonlyMap<ThreadId, OpenCodeSessionContext>, |
| 506 | 480 | threadId: ThreadId, |
| ... | ... | @@ -2365,7 +2339,6 @@ export function makeOpenCodeAdapter( |
| 2365 | 2339 | : "item.updated", |
| 2366 | 2340 | payload, |
| 2367 | 2341 | }; |
| 2368 | | appendTurnItem(context, turnId, part); |
| 2369 | 2342 | yield* emit(runtimeEvent); |
| 2370 | 2343 | } |
| 2371 | 2344 | break; |
| ... | ... | @@ -2853,7 +2826,6 @@ export function makeOpenCodeAdapter( |
| 2853 | 2826 | emittedTextByPartId: new Map(), |
| 2854 | 2827 | messageRoleById: new Map(), |
| 2855 | 2828 | completedAssistantPartIds: new Set(), |
| 2856 | | turns: [], |
| 2857 | 2829 | activeTurnId: undefined, |
| 2858 | 2830 | activeAgent: undefined, |
| 2859 | 2831 | activeVariant: undefined, |