Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preserve native Codex subagent lifecycle in v2 #11996

Closedlnieuwenhuis(GitHub profile, opens in a new tab)wants to merge 3 commits intot3code/codex-turn-mapping fromrefs/pull/11996/headopened View on GitHub

Showing 2 changed files with 233 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
233 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsModified
View file
@@ -5440,6 +5440,239 @@
+ for (const [nativeStatus, expectedStatus, terminal] of [
+ ["pendingInit", "pending", false],
+ ["running", "running", false],
+ ["interrupted", "interrupted", true],
+ ["completed", "completed", true],
+ ["errored", "failed", true],
+ ["shutdown", "cancelled", true],
+ ["notFound", "failed", true],
+ ] as const) {
+ for (const nativeTurnStarted of [false, true]) {
+ it.effect(
Thread on lines 5443 to 5453
juliusmarmingecommented

it.effect.each

+ `maps collaboration subagent status ${nativeStatus} to ${expectedStatus} (native turn: ${nativeTurnStarted})`,
+ () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const nativeThreadId = "collab-parent";
+ const nativeTurnId = "collab-turn";
+ const childThreadId = "collab-child";
+ const prompt = "Delegate a task.";
+ const projected = yield* Deferred.make<void>();
+ const transcript = makeCodexReplayTranscript({
+ scenario: `collab-status-${nativeStatus}`,
+ entries: [
+ ...codexReplayPreamble({ nativeThreadId, nativeTurnId, prompt }),
+ ...[