| … | … | @@ -4305,7 +4306,196 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* ( | |
| 4435 | + | return Effect.void; | |
| 4436 | + | } | |
| 4437 | + | const held = heldExternalTurns.get(nativeTurnId); | |
| 4438 | + | if (held === undefined) return handler(payload); | |
🟠 High Adapters/CodexAdapterV2.ts:4438
A child spawned by an external turn can complete before the parent is adopted, leaving the child projected as running with its transcript missing. handleCodexNotification buffers only frames whose turn ID is in heldExternalTurns; the child’s different turn ID falls through to ordinary handlers, which drop its item and completion events before its context exists. Buffer descendant frames too, or register their contexts before dispatching them.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts around line 4438: |
| 2 | |
| 3 | A child spawned by an external turn can complete before the parent is adopted, leaving the child projected as running with its transcript missing. `handleCodexNotification` buffers only frames whose turn ID is in `heldExternalTurns`; the child’s different turn ID falls through to ordinary handlers, which drop its item and completion events before its context exists. Buffer descendant frames too, or register their contexts before dispatching them. |