Skip to content

[BUG] [v0.0.7] CreateAgent tool writes .toml files into .cortex/agents, so created agents are not discoverable by the standard loader #53529

Description

@DDDDDGCSM

Project

cortex

Description

The CreateAgent tool reports success and writes a file under .cortex/agents/, but it writes <name>.toml. The standard custom-agent loader only discovers Markdown agent files, so the created agent is immediately invisible to normal agent discovery and cannot be delegated to through the standard loader path.

Error Message

No explicit error. The tool returns success, but the created agent does not appear in the standard loader results.

Debug Logs

Focused test:
test_create_agent_project_output_is_not_discoverable_by_standard_loader

Observed file created by CreateAgent:
.cortex/agents/process-and-transform-data-files.toml

Observed loader search paths:
- .agents
- .agent
- .cortex/agents
- ~/.cortex/agents
- ~/Library/Application Support/cortex/agents

Observed loader result:
loaded_names=[]

System Information

cortex source tree v0.0.7
macOS arm64

Screenshots

https://raw.githubusercontent.com/DDDDDGCSM/solid-carnival/master/evidence/cortex-create-agent-toml-proof.png

Steps to Reproduce

  1. Invoke the CreateAgent tool with a valid project-scoped description.
  2. Let it create the agent under .cortex/agents/.
  3. Run the standard custom-agent loader over the same project root.
  4. Observe that the loader returns no agent with that name.

Expected Behavior

A newly created custom agent should be written in the same file format that the standard loader understands, so the created agent is immediately discoverable and usable.

Actual Behavior

CreateAgent writes a TOML file into .cortex/agents/, but the standard loader only discovers Markdown agent files, so the created agent is effectively orphaned.

Additional Context

Code evidence in v0.0.7:

  • src/cortex-engine/src/tools/handlers/create_agent.rs writes agents_dir.join(format!("{}.toml", agent_name))
  • src/cortex-agents/src/custom/loader.rs loads standard agent directories and reads Markdown agent files (*.md)

This is independent from the app-server .factory/agents path mismatch: here the directory is nominally correct, but the file format is incompatible with the loader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideIssues related to IDEvalidValid issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions