Unverified 提交 cb446418 authored 作者: wwwillchen-bot's avatar wwwillchen-bot 提交者: GitHub

feat: increase default max tool call steps from 50 to 100 (#3053)

## Summary - Increased `DEFAULT_MAX_TOOL_CALL_STEPS` from 50 to 100 to better support complex multi-step tasks - Reorganized option tiers: Low (25), Medium (50), Default (100), High (200) — removed the old "Very High" tier - Updated E2E tests and snapshots to reflect the new defaults ## Test plan - [x] Unit tests pass (`npm test` — 44 test files) - [x] Lint, format, and type checks pass - [ ] Verify max tool call steps selector UI shows correct options - [ ] Run E2E test `max_tool_call_steps.spec.ts` to confirm snapshot alignment 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/3053" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> --------- Co-authored-by: 's avatarWill Chen <7344640+wwwillchen@users.noreply.github.com> Co-authored-by: 's avatarClaude <noreply@anthropic.com>
上级 60e7444c
......@@ -4,11 +4,11 @@ import type {
} from "../../../../testing/fake-llm-server/localAgentTypes";
/**
* Fixture that triggers the step limit by generating 50 tool call turns.
* The AI SDK's stepCountIs(50) will stop after 50 steps, and the handler
* Fixture that triggers the step limit by generating 100 tool call turns.
* The AI SDK's stepCountIs(100) will stop after 100 steps, and the handler
* will append a <dyad-step-limit> notice to the response.
*/
const toolCallTurns: Turn[] = Array.from({ length: 50 }, (_, i) => ({
const toolCallTurns: Turn[] = Array.from({ length: 100 }, (_, i) => ({
text: `Step ${i + 1}: reading file.`,
toolCalls: [
{
......@@ -18,7 +18,7 @@ const toolCallTurns: Turn[] = Array.from({ length: 50 }, (_, i) => ({
],
}));
// Final text-only turn (won't be reached because stepCountIs(50) stops first)
// Final text-only turn (won't be reached because stepCountIs(100) stops first)
const finalTurn: Turn = {
text: "All steps completed.",
};
......
......@@ -16,7 +16,7 @@ testSkipIfWindows("local-agent - step limit pause", async ({ po }) => {
// Verify the step limit card is visible
await expect(
po.page.getByText("Paused after 50 tool calls", { exact: true }),
po.page.getByText("Paused after 100 tool calls", { exact: true }),
).toBeVisible({
timeout: Timeout.EXTRA_LONG,
});
......
......@@ -23,11 +23,11 @@ testSkipIfWindows("max tool call steps setting", async ({ po }) => {
await po.navigation.goToSettingsTab();
const beforeSettings2 = po.settings.recordSettings();
// Change to High (100)
// Change to High (200)
await po.page
.getByRole("combobox", { name: "Max Tool Calls (Agent)" })
.click();
await po.page.getByRole("option", { name: "High (100)" }).click();
await po.page.getByRole("option", { name: "High (200)" }).click();
po.settings.snapshotSettingsDelta(beforeSettings2);
// Change back to Default
......@@ -38,6 +38,6 @@ testSkipIfWindows("max tool call steps setting", async ({ po }) => {
await po.page
.getByRole("combobox", { name: "Max Tool Calls (Agent)" })
.click();
await po.page.getByRole("option", { name: "Default (50)" }).click();
await po.page.getByRole("option", { name: "Default (100)" }).click();
po.settings.snapshotSettingsDelta(beforeSettings3);
});
- "maxToolCallSteps": 25
+ "maxToolCallSteps": 100
\ No newline at end of file
+ "maxToolCallSteps": 200
\ No newline at end of file
- "maxToolCallSteps": 100
\ No newline at end of file
- "maxToolCallSteps": 200
\ No newline at end of file
......@@ -25,21 +25,21 @@ const options: OptionInfo[] = [
description:
"Limits tool calls to 25. Good for simple tasks that don't need many steps.",
},
{
value: "50",
label: "Medium (50)",
description: "Moderate limit for straightforward tasks.",
},
{
value: defaultValue,
label: `Default (${DEFAULT_MAX_TOOL_CALL_STEPS})`,
description: "Balanced limit for most tasks.",
},
{
value: "100",
label: "High (100)",
description: "Extended limit for complex multi-step tasks.",
},
{
value: "200",
label: "Very High (200)",
label: "High (200)",
description:
"Maximum tool calls for very complex tasks (may increase cost and time).",
"Extended limit for complex multi-step tasks (may increase cost and time).",
},
];
......@@ -57,11 +57,17 @@ export const MaxToolCallStepsSelector: React.FC = () => {
};
// Determine the current value
const currentValue = settings?.maxToolCallSteps?.toString() || defaultValue;
const rawValue = settings?.maxToolCallSteps;
const currentValue =
rawValue == null || rawValue === DEFAULT_MAX_TOOL_CALL_STEPS
? defaultValue
: rawValue.toString();
// Find the current option to display its description
const currentOption =
options.find((opt) => opt.value === currentValue) || options[1];
options.find((opt) => opt.value === currentValue) ||
options.find((opt) => opt.value === defaultValue) ||
options[0];
return (
<div className="space-y-1">
......
export const MAX_CHAT_TURNS_IN_CONTEXT = 3;
export const DEFAULT_MAX_TOOL_CALL_STEPS = 50;
export const DEFAULT_MAX_TOOL_CALL_STEPS = 100;
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论