Add capability-probed structured outputs and a prototype/instance creation graph.
Probe API profiles for json_schema/tools, flatten worker artifacts onto a strict schema, and let users spawn or revise graph nodes instead of a one-shot DAG. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
createMockToolCall,
|
||||
MockLlmProvider,
|
||||
} from "../src/llm/client.js";
|
||||
import { isUnusableMainAgentOutput } from "../src/main-agent/main-agent.js";
|
||||
import { runMainAgentToolLoop } from "../src/main-agent/tool-loop.js";
|
||||
import { MAIN_AGENT_TOOL_DEFINITIONS } from "../src/main-agent/tools.js";
|
||||
import { toolCallToDecision } from "../src/runtime/tool-registry.js";
|
||||
@@ -29,6 +30,15 @@ describe("main agent tool loop", () => {
|
||||
).toEqual(["read_blackboard", "run_worker"]);
|
||||
});
|
||||
|
||||
it("detects unusable main agent output", () => {
|
||||
expect(
|
||||
isUnusableMainAgentOutput(
|
||||
new Error("Main Agent returned invalid JSON: Let me analyze"),
|
||||
),
|
||||
).toBe(true);
|
||||
expect(isUnusableMainAgentOutput(new Error("fetch failed"))).toBe(false);
|
||||
});
|
||||
|
||||
it("runs loop tools then returns terminal decision", async () => {
|
||||
const llm = new MockLlmProvider([
|
||||
createMockToolCall("read_blackboard", { tags: ["book.brief"] }),
|
||||
|
||||
Reference in New Issue
Block a user