fix: Task tool subagent spawn and isolated block labels (#561)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -453,4 +453,38 @@ describe("input-format stream-json", () => {
|
||||
},
|
||||
{ timeout: 200000 },
|
||||
);
|
||||
|
||||
test(
|
||||
"Task tool with explore subagent works",
|
||||
async () => {
|
||||
// Prescriptive prompt to ensure Task tool is used
|
||||
const objects = (await runBidirectional(
|
||||
[
|
||||
JSON.stringify({
|
||||
type: "user",
|
||||
message: {
|
||||
role: "user",
|
||||
content:
|
||||
"You MUST use the Task tool with subagent_type='explore' to find TypeScript files (*.ts) in the src directory. " +
|
||||
"Return only the subagent's report, nothing else.",
|
||||
},
|
||||
}),
|
||||
],
|
||||
[],
|
||||
300000, // 5 min timeout - subagent spawn + execution can be slow
|
||||
)) as WireMessage[];
|
||||
|
||||
// Should have a successful result
|
||||
const result = objects.find(
|
||||
(o): o is ResultMessage => o.type === "result",
|
||||
);
|
||||
expect(result).toBeDefined();
|
||||
expect(result?.subtype).toBe("success");
|
||||
|
||||
// Should have auto_approval events (Task tool was auto-approved via --yolo)
|
||||
const autoApprovals = objects.filter((o) => o.type === "auto_approval");
|
||||
expect(autoApprovals.length).toBeGreaterThan(0);
|
||||
},
|
||||
{ timeout: 320000 },
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user