Revert tool-choice forcing — the Codex regression was strict:null
The GPT-account (Codex) path supports tool calls and worked before; my forced tool_choice broke it and was the wrong fix. The real regression was strict:null in the rebuild's tool definitions, which made the endpoint drop the tool list so the model had nothing to call — a "Done" run that hired no one. Forcing then turned that silent failure into a red one. Restore the original "auto" loop (no forced tool_choice, no finish tool) and keep only the one-line strict:null omission. Codex now receives valid tools on the working "auto" choice, as in the version that worked. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
74422da4f8
commit
97242ae684
13 files changed
+57
-160
No files matched your search
@@ -37,7 +37,7 @@ function scriptedTeam(): (input: ProviderToolTurnInput) => Promise<AgentTurnResu
|
||||
call("create_task", { title: "Build the booking API", description: "Ship the booking API.", assignee_agent_name: "Dana Lee" }),
|
||||
call("send_message", { channel: "engineering", body: `@${handle} you own the booking API — kicking off here.` }),
|
||||
] },
|
||||
{ text: "Kickoff complete.", toolCalls: [call("finish", {})] },
|
||||
{ text: "Kickoff complete.", toolCalls: [] },
|
||||
];
|
||||
return async (input: ProviderToolTurnInput): Promise<AgentTurnResult> => {
|
||||
if ((input.instructions ?? "").includes("Dana Lee")) {
|
||||
@@ -46,11 +46,11 @@ function scriptedTeam(): (input: ProviderToolTurnInput) => Promise<AgentTurnResu
|
||||
const threadId = firstUser ? /thread_id="([^"]+)"/.exec(firstUser.text)?.[1] : undefined;
|
||||
const turn = dana === 0
|
||||
? { text: "On it.", toolCalls: [call("send_message", { channel: "engineering", body: "On it — booking API design starting now.", ...(threadId ? { thread_id: threadId } : {}) })] }
|
||||
: { text: "Replied.", toolCalls: [call("finish", {})] };
|
||||
: { text: "Replied.", toolCalls: [] };
|
||||
dana += 1;
|
||||
return { text: turn.text, toolCalls: turn.toolCalls, rawResponseJson: "{}" };
|
||||
}
|
||||
const turn = ceoScript[ceo] ?? { text: "done", toolCalls: [call("finish", {})] };
|
||||
const turn = ceoScript[ceo] ?? { text: "done", toolCalls: [] };
|
||||
ceo += 1;
|
||||
return { text: turn.text, toolCalls: turn.toolCalls, rawResponseJson: "{}" };
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ function scriptedCeo(): (input: ProviderToolTurnInput) => Promise<AgentTurnResul
|
||||
call("write_deliverable", { path: "plan/operating-plan.md", content: "# OrbitOps Operating Plan\n\n- Validate demand\n- Launch booking site\n" }),
|
||||
] },
|
||||
{ text: "Handing off the plan.", toolCalls: [] },
|
||||
{ text: "Team staffed, work delegated, plan written.", toolCalls: [call("finish", {})] },
|
||||
{ text: "Team staffed, work delegated, plan written.", toolCalls: [] },
|
||||
];
|
||||
let index = 0;
|
||||
return async (input) => {
|
||||
@@ -55,7 +55,7 @@ function scriptedCeo(): (input: ProviderToolTurnInput) => Promise<AgentTurnResul
|
||||
rawResponseJson: JSON.stringify({ id: `resp_${index}` }),
|
||||
};
|
||||
}
|
||||
const turn = script[index] ?? { text: "done", toolCalls: [call("finish", {})] };
|
||||
const turn = script[index] ?? { text: "done", toolCalls: [] };
|
||||
index += 1;
|
||||
return { text: turn.text, toolCalls: turn.toolCalls, rawResponseJson: JSON.stringify({ id: `resp_${index}` }) };
|
||||
};
|
||||
@@ -166,17 +166,11 @@ describe("autonomous bootstrap run", () => {
|
||||
|
||||
test("a goal created after onboarding reaches the CEO and runs autonomously", async () => {
|
||||
const connection = new DatabaseConnection(join(tmpdir(), `ac-goal-${randomUUID()}.db`));
|
||||
// The forced opening turn means each run must take a concrete action; it
|
||||
// posts to the company channel, then stops on the next (free) turn.
|
||||
const providers = new ProviderService(connection.db, providerAdapters, testVault, undefined, async (input) => {
|
||||
const acted = input.messages.some((message) => message.role === "tool");
|
||||
if (acted) return { text: "Done.", toolCalls: [call("finish", {})], rawResponseJson: JSON.stringify({ id: "resp_goal_done" }) };
|
||||
return {
|
||||
text: "Reviewing the goal.",
|
||||
toolCalls: [call("send_message", { channel: "general", body: "Reviewed the goal and posting the operating plan." })],
|
||||
rawResponseJson: JSON.stringify({ id: "resp_goal_act" }),
|
||||
};
|
||||
});
|
||||
const providers = new ProviderService(connection.db, providerAdapters, testVault, undefined, async () => ({
|
||||
text: "Reviewed the goal and posted the operating plan.",
|
||||
toolCalls: [],
|
||||
rawResponseJson: JSON.stringify({ id: "resp_goal" }),
|
||||
}));
|
||||
const onboarding = new OnboardingService({ db: connection.db, saveProviderCredential: (input) => providers.saveCredential(input) });
|
||||
const organization = new OrganizationService(connection.db);
|
||||
const taskExecution = new TaskExecutionService(connection.db, providers);
|
||||
|
||||
Reference in new issue
Block a user