Skip to content

Commit c3eda49

Browse files
test(server): delegation guidance tests use literal substring checks (#20053)
Replaces the new regex assertions, which backtracked badly on malformed input, with plain includes checks. Rewraps the delegation doc paragraph. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 9153bf8 commit c3eda49

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

‎apps/server/src/mcp/McpHttpServer.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,12 @@ it.effect.each(["limit", "runLimit", "maxCharsPerItem"])(
424424

425425
it("routes same-child follow-ups to t3_thread_send and independent reviews to delegate_task", () => {
426426
const description = OrchestratorToolkit.tools.delegate_task.description ?? "";
427-
expect(description).toMatch(/independent[^.]*review rounds?, call delegate_task again/i);
428-
expect(description).toMatch(/same child's conversation[^.]*t3_thread_send[^.]*childThreadId/);
427+
expect(description).toContain(
428+
"For independent T3 delegated review rounds, call delegate_task again",
429+
);
430+
expect(description).toContain(
431+
"For a follow-up that needs the same child's conversation, use t3_thread_send on its childThreadId.",
432+
);
429433
expect(description).not.toContain("not the target for starting another");
430434
});
431435

‎apps/server/src/provider/CodexDeveloperInstructions.test.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,17 @@ describe("Codex orchestration context", () => {
4949
.map(([, entry]) => entry.value)
5050
.join("\n");
5151

52-
NodeAssert.match(orchestration, /independent[^.]*review rounds?, call `delegate_task` again/i);
53-
NodeAssert.match(
54-
orchestration,
55-
/same child's conversation[^.]*`t3_thread_send`[^.]*`childThreadId`/,
52+
NodeAssert.ok(
53+
orchestration.includes(
54+
"For independent T3 delegated review rounds, call `delegate_task` again.",
55+
),
5656
);
57-
NodeAssert.doesNotMatch(orchestration, /Do not use `t3_thread_send`/);
57+
NodeAssert.ok(
58+
orchestration.includes(
59+
"For a follow-up that needs the same child's conversation, use `t3_thread_send` on its `childThreadId`.",
60+
),
61+
);
62+
NodeAssert.ok(!orchestration.includes("Do not use `t3_thread_send`"));
5863
});
5964
});
6065

‎docs/orchestration-v2/orchestrator-mcp-server.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@ omits it for a provider that offers all of them. When the target lists
252252
`runtimeModes`, an explicit `runtimeMode` outside that list is refused, and an
253253
inherited mode steps down to the broadest mode the target offers.
254254

255-
Each independent delegated review round uses a new `delegate_task` call with the original brief,
256-
prior findings, responses, and unresolved objections. Track each round by its own `taskId` and use
257-
a distinct `clientRequestId` per round, stable across retries of that round.
255+
Each independent delegated review round uses a new `delegate_task` call with the
256+
original brief, prior findings, responses, and unresolved objections. Track each
257+
round by its own `taskId` and use a distinct `clientRequestId` per round, stable
258+
across retries of that round.
258259
A follow-up that needs the same child's conversation goes through `t3_thread_send`
259260
on its `childThreadId`. After the original task completes, that follow-up runs as a
260261
fresh task in the child thread; it does not reopen the completed task or change its

0 commit comments

Comments
 (0)