Skip to content

Commit 3529898

Browse files
committed
Allow Discord agent multi-step tool loops.
Set a max step budget so the prompt agent can perform multiple tool calls in a single response cycle instead of stopping after the first step.
1 parent f602053 commit 3529898

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/src/lib/discord/prompt-agent.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { z } from "zod";
99

1010
const DISCORD_AGENT_MODEL = "anthropic/claude-sonnet-4.6";
1111
const MAX_CONTEXT_MESSAGE_LENGTH = 500;
12+
const DISCORD_AGENT_MAX_STEPS = 20;
1213

1314
type RecentDiscordMessage = {
1415
author: string;
@@ -222,6 +223,7 @@ export async function runDiscordPromptAgent(input: {
222223
const { text } = await generateText({
223224
model: getGatewayModel(),
224225
tools: buildTools(),
226+
maxSteps: DISCORD_AGENT_MAX_STEPS,
225227
system: `You are the AllThingsWeb Discord ops assistant.
226228
You can inspect and update AllThingsWeb event data and fetch Luma event payloads.
227229
Use tools whenever the answer depends on current data.

0 commit comments

Comments
 (0)