test(orchestration): replay-recorded subagent narration fixture
Adds a subagent_text replay fixture recorded against the real Claude Agent SDK (CLI 2.1.220): a background subagent that narrates, reads a file, and answers — the exact frame sequence (task_started, ptu-tagged narration text, ptu-tagged Read, ptu-tagged final text, task_notification with the same summary) observed in the production session that motivated the routing fix. The full-orchestrator replay asserts the parent thread carries only the parent's own assistant message while the child thread carries exactly the streamed narration and final answer in stream order with no duplicated notification result. Verified to fail against the pre-fix adapter with three parent assistant messages, reproducing the reported transcript bleed. Recording on the current CLI surfaced two gaps: replay rejected stream_event frames (now part of the recorded diet) and TaskOutput was missing from the known native tool table. Only background subagents forward ptu-tagged assistant text into the parent stream — foreground subagents return text via the Agent tool_result — which is why the pre-existing foreground subagent fixture never exercised this path. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
c65da86a0f
commit
348b2495d4
9 files changed
+224
-2
No files matched your search
@@ -26,6 +26,7 @@ import {
|
||||
MULTI_TURN_SECOND_PROMPT,
|
||||
SIMPLE_PROMPT,
|
||||
SUBAGENT_PROMPT,
|
||||
SUBAGENT_TEXT_PROMPT,
|
||||
THREAD_FORK_NATIVE_PRIOR_TURN_ALPHA_PROMPT,
|
||||
THREAD_FORK_NATIVE_PRIOR_TURN_BETA_PROMPT,
|
||||
THREAD_FORK_NATIVE_PRIOR_TURN_REPEAT_PROMPT,
|
||||
@@ -155,6 +156,12 @@ const CLAUDE_RECORDINGS = {
|
||||
queryMode: "streaming",
|
||||
enableTools: true,
|
||||
},
|
||||
subagent_text: {
|
||||
prompts: [SUBAGENT_TEXT_PROMPT],
|
||||
defaultTranscriptFile: "fixtures/subagent_text/claude_transcript.ndjson",
|
||||
queryMode: "streaming",
|
||||
enableTools: true,
|
||||
},
|
||||
thread_rollback: {
|
||||
prompts: [
|
||||
THREAD_ROLLBACK_FIRST_PROMPT,
|
||||
@@ -365,7 +372,10 @@ const cwd =
|
||||
: await makeCheckpointWorkspace(`claude-agent-sdk-record-${scenario}`));
|
||||
const shouldRemoveCwd = process.env.T3_CLAUDE_REPLAY_CWD === undefined;
|
||||
|
||||
if (shouldRemoveCwd && (scenario === "tool_call_read_only" || scenario === "subagent")) {
|
||||
if (
|
||||
shouldRemoveCwd &&
|
||||
(scenario === "tool_call_read_only" || scenario === "subagent" || scenario === "subagent_text")
|
||||
) {
|
||||
await runFileSystem(
|
||||
Effect.gen(function* () {
|
||||
const fs = yield* FileSystem.FileSystem;
|
||||
|
||||
Reference in new issue
Block a user