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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Respect `maxSteps` in Markdown agent definitions.

## 0.147.2

- Add agent `spawnableBy` configuration to restrict subagent discovery and spawning to specific primary agents.
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 @@ -105,8 +105,9 @@
nil)))

(defn ^:private md->agent-config
[{:keys [description mode model steps tools body inherit spawnableBy disabledTools]}]
(let [tools-map (normalize-tools tools)
[{:keys [description mode model maxSteps steps tools body inherit spawnableBy disabledTools]}]
(let [max-steps (or maxSteps steps)
tools-map (normalize-tools tools)
spawnable-by (normalize-spawnable-by spawnableBy)
disabled-tools (normalize-disabled-tools disabledTools)]
(cond-> {}
Expand All @@ -118,7 +119,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 {}}
Expand Down
7 changes: 6 additions & 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 All @@ -84,6 +84,11 @@
:deny {"foo" {}}}}}
config))))

(testing "maxSteps takes precedence over the legacy steps alias"
(is (= 7
(:maxSteps (#'agents/md->agent-config {:maxSteps 7
:steps 3})))))

(testing "tool entries with regex patterns"
(let [parsed {:tools {"byDefault" "ask"
"allow" ["eca__shell_command(npm run .*)"
Expand Down
Loading