feat(api): make the ai agent step budget a workflow-global setting#2118
feat(api): make the ai agent step budget a workflow-global setting#2118morgan-coded wants to merge 4 commits into
Conversation
|
@morgan-coded Thank you for the contribution! The solution looks good and addresses the immediate issue. My main concern is that introducing a hard-coded minimum of 10 creates implicit behavior that is not visible or configurable by the end user. At the very least, this would need to be clearly documented. This lack of visibility is one of the reasons we have not addressed the issue yet, we want to avoid replacing one surprising default with another. How about considering introducing a workflow-level setting that lets users define the maximum tool-call or step count, defaulting to 10. This would provide a sensible default while making the execution budget explicit and configurable for MCP-heavy workflows. What do you think about this approach? I see this as both a UX and DX concern: users should not have to understand an internal hard-coded constant when debugging why an agent stopped before completing its task. |
|
Thanks, that makes sense. Reworked the step budget as a visible workflow setting with a default of 10; an explicit value still wins, and the tool-count formula plus the MCP-and-memory-only floor are gone. Tool-enabled workflows now default to 10 even when they expose more than nine tools, so larger budgets need to be set explicitly. The focused tests, API checks, and full workspace checks are passing. |
yassinedorbozgithub
left a comment
There was a problem hiding this comment.
Hi @morgan-coded, do you think adding a UI message would help users understand what's happening during the final stage of the execution?
| }, | ||
| }), | ||
| stop_step_count: z.int().positive().optional().meta({ | ||
| title: 'Stop step count', |
There was a problem hiding this comment.
Hi @morgan-coded, do think adding a max value .max(MAX_AI_STEP_BUDGET) can maybe help to avoid any accidental runaway costs
|
Capped |
Hi @morgan-coded, thank you 🙏 for being reactive ⚡ Please don't forget @marrouchi's feedback about making DEFAULT_AI_STEP_BUDGET a workflow global setting |
|
Implemented @marrouchi's workflow-global default. There's now an The per-action value still takes precedence, and the 100-step cap is unchanged. Because this is a new settings group, bootstrap seeding adds it to existing installs without a migration. I'm keeping the "reached max step count" UI message in a separate follow-up PR as agreed. |
|
@morgan-coded, i can't see stop_step_count as global setting after your changes 🧑💻 |
|
Placed it as a site-wide Concretely that means adding the step-budget field to the shared workflow settings schema ( One thing worth your call: that puts an AI-specific field into the generic workflow settings next to Timeout/Retries. Good to go that route, or would you rather it stay AI-scoped somewhere else? |
|
@morgan-coded, yes move them to |
58201df to
e8da937
Compare
|
Moved |


stop_step_countwas hidden, and its implicit default changed with the number of bound tools, so users could not see or configure a stable limit when a workflow stopped early. The setting is now visible with an advertised default of 10, and an explicit value still wins. Tool-enabled workflows, including those with more than nine tools, now use 10 unless configured higher; tool-less runs andstop_tool_callcomposition keep their existing behavior. Fixes #1977