Skip to content

Commit 58ed005

Browse files
committed
docs
1 parent f32d5c9 commit 58ed005

2 files changed

Lines changed: 36 additions & 3 deletions

File tree

docs/config/agents.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,37 @@ There are 2 types of agents defined via `mode` field (when absent, defaults to p
2222
| __explorer__ | subagent | Fast agent specialized for exploring codebases. Finds files by patterns, searches code for keywords, or answers questions about the codebase. Read-only, no edit tools. |
2323
| __general__ | subagent | General-purpose agent for researching complex questions and executing multi-step tasks. Can be used to execute multiple units of work in parallel. |
2424

25+
## Inheriting from other agents
26+
27+
You can create a new agent that inherits all settings from an existing agent using the `inherit` key. The new agent's settings are deep-merged on top of the inherited agent's settings, so any field you specify overrides the parent's value while the rest is preserved.
28+
29+
This is useful when you want a variant of a built-in or custom agent with small tweaks, without duplicating the entire configuration.
30+
31+
=== "Config"
32+
33+
```javascript title="~/.config/eca/config.json"
34+
{
35+
"agent": {
36+
"my-plan": {
37+
"inherit": "plan",
38+
"defaultModel": "openai/gpt-5"
39+
}
40+
}
41+
}
42+
```
43+
44+
The `my-plan` agent above inherits all of `plan`'s configuration (disabled tools, tool approval rules, prompts, etc.) but uses a different default model.
45+
46+
=== "Markdown"
47+
48+
```markdown title=".eca/agents/my-explorer.md"
49+
---
50+
inherit: explorer
51+
description: Explorer with a custom model
52+
defaultModel: google/gemini-2.5-pro
53+
---
54+
```
55+
2556
## Custom agents and prompts
2657

2758
You can create an agent and define its prompt, tool call approval and default model.
@@ -64,10 +95,11 @@ The major advantages of subagents are:
6495

6596
Subagents can be configured in config or markdown and support/require these fields:
6697

67-
- `mode` (required): `subagent` always, this is waht differ a primary agent than a subagent for ECA.
98+
- `mode` (required): `subagent` always, this is what differs a primary agent from a subagent for ECA.
6899
- `description` (required): a short summary of what this subagent will do, this is important to primary agent knows when to delegate to it.
69-
- `systemPrompt` or the markdown content (required): Instructions for the subagent to what do when receive a task.
100+
- `systemPrompt` or the markdown content (required unless using `inherit`): Instructions for the subagent to what do when receive a task.
70101

102+
- `inherit` (optional): name of another agent to inherit all settings from. The subagent's own fields are merged on top.
71103
- `model` (optional): which full model to use for this subagent, using primary agent model if not specified.
72104
- `tools` (optional): same as ECA tool approval logic to control what tools are allowed/askable/denied.
73105
- `maxSteps` (optional): set a max limit of turns/steps that his subagent must finish and return an answer.

src/eca/features/agents.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
(into {} (map (fn [name] [(str name) {}]) tool-names))))
2121

2222
(defn ^:private md->agent-config
23-
[{:keys [description mode model steps tools body]}]
23+
[{:keys [description mode model steps tools body inherit]}]
2424
(cond-> {}
25+
inherit (assoc :inherit (str inherit))
2526
description (assoc :description description)
2627
mode (assoc :mode (str mode))
2728
model (assoc :defaultModel (str model))

0 commit comments

Comments
 (0)