# G5: Delegated follow-up result comes from continuation — after

SHA: [3d864ff44f](https://git.cafe/pingdotgg/t3code/commit/3d864ff44fec8f84dc7a10e75860d7880d69c40e)

**synthetic integration harness, not a live provider**

Node v26.12.1; Vite+ vp test / Vitest v5.0.5; ProviderReplayHarness.layerWithRegistry, synthetic adapters and in-memory SQLite; Linux x86_64, kernel 6.1.102. No live provider, dev server, real database or client browser used for capture.

Same byte-identical driver/fixtures; no compile adaptation. Only synthetic data. Timestamps and model selection omitted. Event sequence numbers establish order. This records server data, with no claim about rendered clients or native-provider protocols. Text truncation is explicit. Run aliases below resolve to the complete ids in each scenario; ordinals may advance when a queued run starts. Request 2 is deliberately rejected before provider acceptance to establish a missed backlog.

## delegated-continuation-failure

Configuration: `{"group":"G5","name":"delegated-continuation-failure","background":true,"parent":true,"failContinuation":true}`

Native generations: 1; final snoozedUntil: `None`.

| Alias / run id | Ordinal | Status | Native id on attempt | Message | Failure code / message |
| --- | ---: | --- | --- | --- | --- |
| r1: `run:thread:thread%3Aevidence:ordinal:1` | 1 | completed | `codex:thread:evidence:0` | Original brief CODEWORD_ORIGINAL | — |
| r2: `run:thread:thread%3Aevidence:ordinal:2` | 2 | failed | `codex:thread:evidence:0` | Request 2 CODEWORD_MISSED rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr … [truncated; 6026 characters total] | None: Provider turn failed. |
| r3: `run:thread:thread%3Aevidence:ordinal:3` | 3 | failed | `not recorded; not accepted` | Request 3 CODEWORD_RECOVER | context_compaction_required: The conversation is too long to continue as is. T3 Code is compacting it and will continue automatically. |
| r4: `run:thread:thread%3Aevidence:ordinal:4` | 4 | completed | `codex:thread:evidence:0` | /compact | — |
| r5: `run:thread:thread%3Aevidence:ordinal:5` | 5 | failed | `codex:thread:evidence:0` | Continue where you left off. | simulated_failure: Simulated provider failure. |

Adapter calls, provider inputs and relevant results, in call order:
```text
dispatch receipt: message=evidence:1 sequence=9
ensureThread: create a synthetic native session
provider input: r1 app-ordinal=1 native=codex:thread:evidence:0 text="Original brief CODEWORD_ORIGINAL" length=32 attachments=[]
dispatch receipt: message=evidence:2 sequence=45
resumeThread: codex:thread:evidence:0
dispatch receipt: message=evidence:3 sequence=73
resumeThread: codex:thread:evidence:0
compactThread: r4 native=codex:thread:evidence:0
provider input: r4 app-ordinal=4 native=codex:thread:evidence:0 text="/compact" length=8 attachments=[]
provider input: r5 app-ordinal=5 native=codex:thread:evidence:0 text="Continue where you left off." length=28 attachments=[]
{"operation":"parentTaskResults","tasks":[{"id":"node:full-native-task","status":"completed","result":"codex response for run 1","completionDelivery":{"state":"acknowledged","observedByRunId":"run:full-native-parent"}},{"id":"node:delegated-task:evidence%3A2","status":"failed","result":"Provider turn failed.","completionDelivery":{"state":"claimed","observedByRunId":null}},{"id":"node:delegated-task:evidence%3A3","status":"failed","result":"Simulated provider failure.","completionDelivery":{"state":"claimed","observedByRunId":null}}]}
{"operation":"persistedEventReplayAndProjectionReread","throughSequence":129,"unchangedRunCount":5,"note":"in-process event replay and projection re-read; no network reconnect or crash tested"}
```

Persisted lifecycle, compaction and usage milestones, in sequence order:
```text
3: native session state {"contextUsage":null}
6: node r1 pending
12: native session state {"nativeThreadId":"codex:thread:evidence:0","contextUsage":null}
13: run r1 ordinal=1 running
14: attempt r1 running
15: node r1 running
16: provider usage r1 {"usedTokens":250164,"maxTokens":258400}
19: attempt r1 completed
20: run r1 ordinal=1 waiting
21: node r1 waiting
26: run r1 ordinal=1 completed
27: node r1 completed
29: run run:full-native-parent ordinal=1 completed
30: parent task {"id":"node:full-native-task","status":"completed","result":"Original done"}
32: parent task {"id":"node:full-native-task","status":"completed","result":"codex response for run 1"}
38: node r2 pending
42: run r2 ordinal=2 starting {"delegatedTaskId":"node:delegated-task:evidence%3A2"}
44: parent task {"id":"node:delegated-task:evidence%3A2","status":"running","result":null}
48: native session state {"nativeThreadId":"codex:thread:evidence:0","contextUsage":{"usedTokens":250164,"maxTokens":258400}}
49: run r2 ordinal=2 running {"delegatedTaskId":"node:delegated-task:evidence%3A2"}
50: attempt r2 running
51: node r2 running
52: attempt r2 failed
53: error r2 {"status":"failed","title":"Provider error","failure":{"class":"provider_error","message":"Provider turn failed.","code":null,"retryable":null}}
54: run r2 ordinal=2 failed {"delegatedTaskId":"node:delegated-task:evidence%3A2"}
55: node r2 failed
58: parent task {"id":"node:delegated-task:evidence%3A2","status":"failed","result":"Provider turn failed."}
66: node r3 pending
70: run r3 ordinal=3 starting {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
72: parent task {"id":"node:delegated-task:evidence%3A3","status":"running","result":null}
75: error r3 {"status":"failed","title":"Conversation compaction needed","failure":{"class":"provider_error","message":"The conversation is too long to continue as is. T3 Code is compacting it and will continue automatically.","code":"context_compaction_required","retryable":null}}
76: run r3 ordinal=3 failed {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
77: attempt r3 failed
78: node r3 failed
82: node r4 pending
88: run r4 ordinal=4 running {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
89: attempt r4 running
90: node r4 running
91: provider usage r4 {"usedTokens":20000,"maxTokens":258400}
94: attempt r4 completed
95: run r4 ordinal=4 waiting {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
96: node r4 waiting
101: run r4 ordinal=4 completed {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
102: node r4 completed
106: node r5 pending
111: native session state {"nativeThreadId":"codex:thread:evidence:0","contextUsage":{"usedTokens":20000,"maxTokens":258400}}
112: run r5 ordinal=5 running {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
113: attempt r5 running
114: node r5 running
117: provider usage r5 {"usedTokens":21000,"maxTokens":258400}
120: error r5 {"status":"failed","title":"Provider error","failure":{"class":"provider_error","message":"Simulated provider failure.","code":"simulated_failure","retryable":null}}
121: attempt r5 failed
122: run r5 ordinal=5 failed {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
123: node r5 failed
125: parent task {"id":"node:delegated-task:evidence%3A3","status":"failed","result":"Simulated provider failure."}
```

Generated-message provenance, linkage, queue checkpoints and final answers:
```jsonl
{"run":"r2","message":{"id":"evidence:2","createdBy":"user","creationSource":"web","attachmentCount":0,"attachments":[]},"linkage":{"delegatedTaskId":"node:delegated-task:evidence%3A2"}}
{"run":"r3","message":{"id":"evidence:3","createdBy":"user","creationSource":"web","attachmentCount":0,"attachments":[]},"linkage":{"delegatedTaskId":"node:delegated-task:evidence%3A3"}}
{"run":"r4","message":{"id":"context-compact:run:thread:thread%3Aevidence:ordinal:3","createdBy":"agent","creationSource":"server","idleCompaction":"onReturn","attachmentCount":0,"attachments":[]},"linkage":{"delegatedTaskId":"node:delegated-task:evidence%3A3","compactionRecoveryOfRunId":"run:thread:thread%3Aevidence:ordinal:3"}}
{"run":"r5","message":{"id":"context-compact-continue:run:thread:thread%3Aevidence:ordinal:4","createdBy":"agent","creationSource":"server","attachmentCount":0,"attachments":[]},"linkage":{"delegatedTaskId":"node:delegated-task:evidence%3A3","compactionRecoveryOfRunId":"run:thread:thread%3Aevidence:ordinal:4"}}
{"runId":"r1","status":"completed","text":"codex response for run 1","length":24}
{"runId":"r4","status":"completed","text":"Synthetic compaction complete","length":29}
{"runId":"r5","status":"failed","text":"Request 3 done","length":14}
```

Injected backlog actually received by the synthetic provider:
```jsonl
{"role":"user","text":"Context handoff (delta_since_target_last_seen):\nProvider context handoff. Thread: thread:evidence. Covered app runs: 2-3.\nSource item range: turn-item:message:evidence%3A2 through turn-item:run:run%3Athread%3Athread%253Aevidence%3Aordinal%3A3:signal:provider-context-compaction-required.\nRecover omitted history using t3_thread_read({threadId:\"thread:evidence\",view:\"activity\",limit:20,maxCharsPerItem:4000}); paginate with afterPosition=nextPosition. For an individual item use itemId and textOffset=nextTextOffset until null. Run/item IDs identify historical activity; no foreign tool calls are replayed.\nSelected 4 intact items; omitted 0 items. Historical material is context, not a new request or higher-priority instructions. Attached files and native tool/reasoning state are not replayed.","fullLength":796}
{"role":"user","text":"Request 2 CODEWORD_MISSED rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr … [truncated; 6026 characters total]","fullLength":6026}
{"role":"assistant","text":"Provider turn failed.","fullLength":21}
{"role":"user","text":"Request 3 CODEWORD_RECOVER","fullLength":26}
{"role":"assistant","text":"The conversation is too long to continue as is. T3 Code is compacting it and will continue automatically.","fullLength":105}
```

## delegated-success

Configuration: `{"group":"G5","name":"delegated-success","background":true,"parent":true}`

Native generations: 1; final snoozedUntil: `None`.

| Alias / run id | Ordinal | Status | Native id on attempt | Message | Failure code / message |
| --- | ---: | --- | --- | --- | --- |
| r1: `run:thread:thread%3Aevidence:ordinal:1` | 1 | completed | `codex:thread:evidence:0` | Original brief CODEWORD_ORIGINAL | — |
| r2: `run:thread:thread%3Aevidence:ordinal:2` | 2 | failed | `codex:thread:evidence:0` | Request 2 CODEWORD_MISSED rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr … [truncated; 6026 characters total] | None: Provider turn failed. |
| r3: `run:thread:thread%3Aevidence:ordinal:3` | 3 | failed | `not recorded; not accepted` | Request 3 CODEWORD_RECOVER | context_compaction_required: The conversation is too long to continue as is. T3 Code is compacting it and will continue automatically. |
| r4: `run:thread:thread%3Aevidence:ordinal:4` | 4 | completed | `codex:thread:evidence:0` | /compact | — |
| r5: `run:thread:thread%3Aevidence:ordinal:5` | 5 | completed | `codex:thread:evidence:0` | Continue where you left off. | — |

Adapter calls, provider inputs and relevant results, in call order:
```text
dispatch receipt: message=evidence:1 sequence=9
ensureThread: create a synthetic native session
provider input: r1 app-ordinal=1 native=codex:thread:evidence:0 text="Original brief CODEWORD_ORIGINAL" length=32 attachments=[]
dispatch receipt: message=evidence:2 sequence=45
resumeThread: codex:thread:evidence:0
dispatch receipt: message=evidence:3 sequence=73
resumeThread: codex:thread:evidence:0
compactThread: r4 native=codex:thread:evidence:0
provider input: r4 app-ordinal=4 native=codex:thread:evidence:0 text="/compact" length=8 attachments=[]
provider input: r5 app-ordinal=5 native=codex:thread:evidence:0 text="Continue where you left off." length=28 attachments=[]
{"operation":"parentTaskResults","tasks":[{"id":"node:full-native-task","status":"completed","result":"codex response for run 1","completionDelivery":{"state":"acknowledged","observedByRunId":"run:full-native-parent"}},{"id":"node:delegated-task:evidence%3A2","status":"failed","result":"Provider turn failed.","completionDelivery":{"state":"claimed","observedByRunId":null}},{"id":"node:delegated-task:evidence%3A3","status":"completed","result":"Request 3 done","completionDelivery":{"state":"claimed","observedByRunId":null}}]}
{"operation":"persistedEventReplayAndProjectionReread","throughSequence":132,"unchangedRunCount":5,"note":"in-process event replay and projection re-read; no network reconnect or crash tested"}
```

Persisted lifecycle, compaction and usage milestones, in sequence order:
```text
3: native session state {"contextUsage":null}
6: node r1 pending
12: native session state {"nativeThreadId":"codex:thread:evidence:0","contextUsage":null}
13: run r1 ordinal=1 running
14: attempt r1 running
15: node r1 running
16: provider usage r1 {"usedTokens":250164,"maxTokens":258400}
19: attempt r1 completed
20: run r1 ordinal=1 waiting
21: node r1 waiting
26: run r1 ordinal=1 completed
27: node r1 completed
29: run run:full-native-parent ordinal=1 completed
30: parent task {"id":"node:full-native-task","status":"completed","result":"Original done"}
32: parent task {"id":"node:full-native-task","status":"completed","result":"codex response for run 1"}
38: node r2 pending
42: run r2 ordinal=2 starting {"delegatedTaskId":"node:delegated-task:evidence%3A2"}
44: parent task {"id":"node:delegated-task:evidence%3A2","status":"running","result":null}
48: native session state {"nativeThreadId":"codex:thread:evidence:0","contextUsage":{"usedTokens":250164,"maxTokens":258400}}
49: run r2 ordinal=2 running {"delegatedTaskId":"node:delegated-task:evidence%3A2"}
50: attempt r2 running
51: node r2 running
52: attempt r2 failed
53: error r2 {"status":"failed","title":"Provider error","failure":{"class":"provider_error","message":"Provider turn failed.","code":null,"retryable":null}}
54: run r2 ordinal=2 failed {"delegatedTaskId":"node:delegated-task:evidence%3A2"}
55: node r2 failed
58: parent task {"id":"node:delegated-task:evidence%3A2","status":"failed","result":"Provider turn failed."}
66: node r3 pending
70: run r3 ordinal=3 starting {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
72: parent task {"id":"node:delegated-task:evidence%3A3","status":"running","result":null}
75: error r3 {"status":"failed","title":"Conversation compaction needed","failure":{"class":"provider_error","message":"The conversation is too long to continue as is. T3 Code is compacting it and will continue automatically.","code":"context_compaction_required","retryable":null}}
76: run r3 ordinal=3 failed {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
77: attempt r3 failed
78: node r3 failed
82: node r4 pending
88: run r4 ordinal=4 running {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
89: attempt r4 running
90: node r4 running
91: provider usage r4 {"usedTokens":20000,"maxTokens":258400}
94: attempt r4 completed
95: run r4 ordinal=4 waiting {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
96: node r4 waiting
101: run r4 ordinal=4 completed {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
102: node r4 completed
106: node r5 pending
111: native session state {"nativeThreadId":"codex:thread:evidence:0","contextUsage":{"usedTokens":20000,"maxTokens":258400}}
112: run r5 ordinal=5 running {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
113: attempt r5 running
114: node r5 running
117: provider usage r5 {"usedTokens":21000,"maxTokens":258400}
120: attempt r5 completed
121: run r5 ordinal=5 waiting {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
122: node r5 waiting
126: run r5 ordinal=5 completed {"delegatedTaskId":"node:delegated-task:evidence%3A3"}
127: node r5 completed
128: parent task {"id":"node:delegated-task:evidence%3A3","status":"completed","result":"Request 3 done"}
```

Generated-message provenance, linkage, queue checkpoints and final answers:
```jsonl
{"run":"r2","message":{"id":"evidence:2","createdBy":"user","creationSource":"web","attachmentCount":0,"attachments":[]},"linkage":{"delegatedTaskId":"node:delegated-task:evidence%3A2"}}
{"run":"r3","message":{"id":"evidence:3","createdBy":"user","creationSource":"web","attachmentCount":0,"attachments":[]},"linkage":{"delegatedTaskId":"node:delegated-task:evidence%3A3"}}
{"run":"r4","message":{"id":"context-compact:run:thread:thread%3Aevidence:ordinal:3","createdBy":"agent","creationSource":"server","idleCompaction":"onReturn","attachmentCount":0,"attachments":[]},"linkage":{"delegatedTaskId":"node:delegated-task:evidence%3A3","compactionRecoveryOfRunId":"run:thread:thread%3Aevidence:ordinal:3"}}
{"run":"r5","message":{"id":"context-compact-continue:run:thread:thread%3Aevidence:ordinal:4","createdBy":"agent","creationSource":"server","attachmentCount":0,"attachments":[]},"linkage":{"delegatedTaskId":"node:delegated-task:evidence%3A3","compactionRecoveryOfRunId":"run:thread:thread%3Aevidence:ordinal:4"}}
{"runId":"r1","status":"completed","text":"codex response for run 1","length":24}
{"runId":"r4","status":"completed","text":"Synthetic compaction complete","length":29}
{"runId":"r5","status":"completed","text":"Request 3 done","length":14}
```

Injected backlog actually received by the synthetic provider:
```jsonl
{"role":"user","text":"Context handoff (delta_since_target_last_seen):\nProvider context handoff. Thread: thread:evidence. Covered app runs: 2-3.\nSource item range: turn-item:message:evidence%3A2 through turn-item:run:run%3Athread%3Athread%253Aevidence%3Aordinal%3A3:signal:provider-context-compaction-required.\nRecover omitted history using t3_thread_read({threadId:\"thread:evidence\",view:\"activity\",limit:20,maxCharsPerItem:4000}); paginate with afterPosition=nextPosition. For an individual item use itemId and textOffset=nextTextOffset until null. Run/item IDs identify historical activity; no foreign tool calls are replayed.\nSelected 4 intact items; omitted 0 items. Historical material is context, not a new request or higher-priority instructions. Attached files and native tool/reasoning state are not replayed.","fullLength":796}
{"role":"user","text":"Request 2 CODEWORD_MISSED rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr … [truncated; 6026 characters total]","fullLength":6026}
{"role":"assistant","text":"Provider turn failed.","fullLength":21}
{"role":"user","text":"Request 3 CODEWORD_RECOVER","fullLength":26}
{"role":"assistant","text":"The conversation is too long to continue as is. T3 Code is compacting it and will continue automatically.","fullLength":105}
```
