Skip to content

docs: custom-agent guide uses agent: but eval parser/schema require skill: #275

Description

@coygeek

Summary

The custom-agent docs tell users to target .agent.md files with a top-level agent: field in eval.yaml, but the current Go eval spec model and JSON schema only accept skill:. Because LoadEvalSpec uses strict YAML parsing, following the docs appears likely to fail before an eval can run.

I could not find a .github/ISSUE_TEMPLATE directory in this repository, so I am using this plain bug report format.

Evidence

  • site/src/content/docs/guides/custom-agents.mdx documents:
  • internal/models/spec.go only has SkillName string yaml:"skill" and no agent field:
    type EvalSpec struct {
    SpecIdentity `yaml:",inline"`
    SkillName string `yaml:"skill"`
    Version string `yaml:"version"`
    Config Config `yaml:"config"`
    Hooks hooks.HooksConfig `yaml:"hooks,omitempty"`
    Inputs map[string]string `yaml:"inputs,omitempty" json:"inputs,omitempty"`
    TasksFrom string `yaml:"tasks_from,omitempty" json:"tasks_from,omitempty"`
    Range [2]int `yaml:"range,omitempty" json:"range,omitempty"`
    Graders []GraderConfig `yaml:"graders"`
    Metrics []MeasurementDef `yaml:"metrics"`
    Tasks []string `yaml:"tasks"`
    Baseline bool `yaml:"baseline,omitempty" json:"baseline,omitempty"`
  • LoadEvalSpec uses decoder.KnownFields(true), so unknown fields should be rejected:
    // LoadEvalSpec loads a spec from a YAML file with strict validation.
    //
    // Normally the schema validation will catch errors in the eval.yaml, but this also does
    // strict YAML parsing to catch errors like unknown fields or type errors that the schema
    // validation might miss.
    func LoadEvalSpec(path string) (*EvalSpec, error) {
    data, err := os.ReadFile(path)
    if err != nil {
    return nil, err
    }
    var spec EvalSpec
    decoder := yaml.NewDecoder(bytes.NewReader(data))
    decoder.KnownFields(true)
    if err := decoder.Decode(&spec); err != nil {
    return nil, fmt.Errorf("parsing eval spec YAML (%s): %w", path, err)
    }
  • schemas/eval.schema.json also requires skill and does not include agent:
    "required": [
    "name",
    "skill",
    "config",
    "metrics",
    "tasks"
    ],
    "additionalProperties": false,

Expected

One of these should be true:

  1. The parser/schema support agent: as a first-class target field, matching the custom-agent docs.
  2. The docs use skill: for custom agents and explain that .agent.md files are currently discovered through the skill-discovery path.

Actual

The docs and source appear to disagree. A user following the docs can write an eval.yaml that the current strict parser/schema do not accept.

Suggested fix

If agent: is intended:

  • Add AgentName string yaml:"agent,omitempty" or equivalent to the eval spec model.
  • Update validation to require exactly one of skill or agent.
  • Update schemas/eval.schema.json with a oneOf/mutual-exclusion rule.
  • Add tests that a custom-agent eval with agent: loads and runs.

If agent: is not intended yet:

  • Update the custom-agent docs and CLI reference to use skill: for .agent.md targets.
  • Add a warning that SKILL.md takes priority when both SKILL.md and .agent.md exist in one directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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