From cba9a641779b0a2384c4d601c297ce21ca9a1217 Mon Sep 17 00:00:00 2001 From: Juha Itkonen Date: Wed, 15 Jul 2026 21:16:19 +0300 Subject: [PATCH] Fix maxSteps in Markdown agent definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Markdown agents document maxSteps, but conversion only recognized the legacy steps key. Accept the documented field while preserving compatibility. 🤖 Generated with [ECA](https://eca.dev) (openai/gpt-5.6-sol - high) Co-Authored-By: eca-agent --- CHANGELOG.md | 1 + src/eca/features/agents.clj | 7 ++++--- test/eca/features/agents_test.clj | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17f8b96cc..77164b0c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Respect `maxSteps` in Markdown agent definitions. - Fix prompt cache invalidation warning after clearing the chat and changing model. #530 - Fix missing line break after "Prompt stopped" message when followed by another system message. diff --git a/src/eca/features/agents.clj b/src/eca/features/agents.clj index 6ae4dfc77..145171fbd 100644 --- a/src/eca/features/agents.clj +++ b/src/eca/features/agents.clj @@ -61,8 +61,9 @@ :else nil)) (defn ^:private md->agent-config - [{:keys [description mode model steps tools body inherit]}] - (let [tools-map (normalize-tools tools)] + [{:keys [description mode model maxSteps steps tools body inherit]}] + (let [max-steps (or maxSteps steps) + tools-map (normalize-tools tools)] (cond-> {} inherit (assoc :inherit (str inherit)) description (assoc :description description) @@ -70,7 +71,7 @@ (mapv str mode) (str mode))) model (assoc :defaultModel (str model)) - steps (assoc :maxSteps (long steps)) + max-steps (assoc :maxSteps (long max-steps)) (seq body) (assoc :systemPrompt body) tools-map (assoc :toolCall (cond-> {:approval {}} diff --git a/test/eca/features/agents_test.clj b/test/eca/features/agents_test.clj index d13144d99..924779c0b 100644 --- a/test/eca/features/agents_test.clj +++ b/test/eca/features/agents_test.clj @@ -62,7 +62,7 @@ "description: You sleep one second when asked\n" "mode: subagent\n" "model: my-org-anthropic/sonnet-4.5\n" - "steps: 5\n" + "maxSteps: 5\n" "tools:\n" " byDefault: ask\n" " deny:\n"