Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
7 changes: 4 additions & 3 deletions src/eca/features/agents.clj
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,17 @@
: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)
mode (assoc :mode (if (sequential? mode)
(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 {}}
Expand Down
2 changes: 1 addition & 1 deletion test/eca/features/agents_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down