Skip to content

Improve dynamic spawn_agent prompt #671

Open

Description

@michaelwhitford

The spawn_agent tool generates a dynamic list of agents to create the prompt. There is a markdown prompt file, and eca appends the lists of agents it builds from markdown files in the ~/.config/eca/agents/ folder. If I replace the prompt for spawn_agent in my local config.json, the list of agents is not appended to my custom prompt. The override for the prompt does not trigger the appending of the list of dynamic agents. So to override the spawn_agent prompt, I have to manually add all the agents to my prompt or else eca will not see them. I would like eca to allow to override the spawn_agent prompt, but still append the list of dynamic agents.

Essentially the spawn_agent prompt is partially generated, and if I use the normal override from config, the generated part is never appended.

The override is at src/eca/features/tools.clj:372
The agent build is at src/eca/features/tools/agent.clj:521

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

Activity

  1. michaelwhitford commented on Oct 26, 2026

    @michaelwhitford
    Author

    The same bug affects fetch_rule

    src/eca/features/tools/fetch_rule.clj:101-116 builds its description the same way (base text plus a list of path-scoped rules). Overriding fetch_rule drops the rules list in the same way.

  2. michaelwhitford commented on Oct 26, 2026

    @michaelwhitford
    Author

    And a succinct summary from AI:

    Root cause: src/eca/features/tools.clj:371-377 (inside all-tools) replaces the tool's whole :description with the prompts.tools. override, using an or.

    For spawn_agent, that description was already built by build-description in src/eca/features/tools/agent.clj:521-531. It's the base text from spawn_agent.md with the "Available agents" list (from all-agents) added to the end. So the override discards the dynamic list along with the base text.

    The same bug affects: fetch_rule in src/eca/features/tools/fetch_rule.clj:101-116. Its path-scoped rules list is lost in the same way.

    Possible fix: keep the dynamic part separate, for example in a :description-suffix key, and add it after the override is applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions