feat: change default max turns for new agents from 10 to 1000

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
gsxdsm
2026-04-12 16:14:54 -07:00
parent f154f688cf
commit 4f662cc56f
4 changed files with 11 additions and 11 deletions

View File

@@ -203,7 +203,7 @@ You MUST respond with ONLY valid JSON (no markdown, no explanation):
"description": "A brief 1-2 sentence description of the agent's purpose and expertise",
"systemPrompt": "A detailed markdown system prompt for the agent. This should be comprehensive and include:\\n- Role definition\\n- Core responsibilities\\n- Specific areas of expertise\\n- Behavioral guidelines\\n- Output format expectations\\n- Edge case handling instructions",
"thinkingLevel": "off | minimal | low | medium | high",
"maxTurns": 10
"maxTurns": 1000
}
## Guidelines for System Prompt Generation

View File

@@ -48,7 +48,7 @@ export function NewAgentDialog({ isOpen, onClose, onCreated, projectId }: NewAge
const [runtimeConfig, setRuntimeConfig] = useState<RuntimeConfig>({
model: "",
thinkingLevel: "off",
maxTurns: 10,
maxTurns: 1000,
});
const [selectedPresetId, setSelectedPresetId] = useState<string | null>(null);
const [isSubmitting, setIsSubmitting] = useState(false);
@@ -151,7 +151,7 @@ export function NewAgentDialog({ isOpen, onClose, onCreated, projectId }: NewAge
setInstructionsText("");
setSoul("");
setMemory("");
setRuntimeConfig({ model: "", thinkingLevel: "off", maxTurns: 10 });
setRuntimeConfig({ model: "", thinkingLevel: "off", maxTurns: 1000 });
setSelectedPresetId(null);
setError(null);
setIsGenerationModalOpen(false);
@@ -166,7 +166,7 @@ export function NewAgentDialog({ isOpen, onClose, onCreated, projectId }: NewAge
const runtimeCfg: Record<string, unknown> = {};
if (runtimeConfig.model.trim()) runtimeCfg.model = runtimeConfig.model.trim();
if (runtimeConfig.thinkingLevel !== "off") runtimeCfg.thinkingLevel = runtimeConfig.thinkingLevel;
if (runtimeConfig.maxTurns !== 10) runtimeCfg.maxTurns = runtimeConfig.maxTurns;
if (runtimeConfig.maxTurns !== 1000) runtimeCfg.maxTurns = runtimeConfig.maxTurns;
await createAgent({
name: name.trim(),
role,
@@ -398,7 +398,7 @@ export function NewAgentDialog({ isOpen, onClose, onCreated, projectId }: NewAge
type="number"
className="input"
min={1}
max={500}
max={2000}
value={runtimeConfig.maxTurns}
onChange={e => setRuntimeConfig(c => ({ ...c, maxTurns: Math.max(1, parseInt(e.target.value, 10) || 1) }))}
/>

View File

@@ -252,7 +252,7 @@ describe("agent-generation module", () => {
expect(spec.description).toBe("");
expect(spec.systemPrompt).toBe("");
expect(spec.thinkingLevel).toBe("off");
expect(spec.maxTurns).toBe(10);
expect(spec.maxTurns).toBe(1000);
});
it("truncates title to 60 characters", () => {
@@ -274,11 +274,11 @@ describe("agent-generation module", () => {
it("clamps maxTurns to valid range", () => {
const json = JSON.stringify({
title: "Test",
maxTurns: 999,
maxTurns: 9999,
});
const spec = parseGenerationResponse(json);
expect(spec.maxTurns).toBe(500);
expect(spec.maxTurns).toBe(2000);
const json2 = JSON.stringify({ title: "Test", maxTurns: -5 });
const spec2 = parseGenerationResponse(json2);

View File

@@ -85,7 +85,7 @@ You MUST respond with ONLY valid JSON (no markdown, no explanation):
"description": "A brief 1-2 sentence description of the agent's purpose and expertise",
"systemPrompt": "A detailed markdown system prompt for the agent. This should be comprehensive and include:\\n- Role definition\\n- Core responsibilities\\n- Specific areas of expertise\\n- Behavioral guidelines\\n- Output format expectations\\n- Edge case handling instructions",
"thinkingLevel": "off | minimal | low | medium | high",
"maxTurns": 10
"maxTurns": 1000
}
## Guidelines for System Prompt Generation
@@ -400,8 +400,8 @@ export function parseGenerationResponse(text: string): AgentGenerationSpec {
? (obj.thinkingLevel as AgentGenerationSpec["thinkingLevel"])
: "off",
maxTurns: typeof obj.maxTurns === "number"
? Math.max(1, Math.min(500, Math.round(obj.maxTurns)))
: 10,
? Math.max(1, Math.min(2000, Math.round(obj.maxTurns)))
: 1000,
};
}