Skip to content

(bug) An agent with a bodyless skill runs in the playground and 500s everywhere else #5591

Description

@mmabrouk

An agent whose saved configuration contains a skill with no body works in the playground and
fails everywhere else. Any caller that runs the saved configuration as stored gets a 500 from
the agent service before the agent starts:

status 500
Invalid skill configuration: [{'type': 'missing', 'loc': ('body',), 'msg': 'Field required'}]
  File "sdks/python/agenta/sdk/agents/skills/parsing.py", line 69, in parse_skill_template

I expect an agent that runs in the playground to run everywhere. I also expect the platform to
refuse to save a skill that has no content, instead of storing it and failing later.

Steps to reproduce

  1. Open an agent that has skills and save a skill without a body. The stored revision then
    holds an entry like this one, taken from a real committed revision:
{
  "name": "keep-docs-in-sync",
  "description": "Keep documentation in sync with a code or contract change in the SAME PR. ..."
}

There is no body key. SkillTemplate.body is required
(sdks/python/agenta/sdk/agents/skills/models.py:93).

  1. Run the agent in the playground. It works.
  2. Invoke the same agent server side, without sending parameters. Two ways to hit this: let a
    schedule run it, or approve one of its parked approvals, which starts a new run from the
    stored configuration.
  3. The run fails with the 500 above. The agent never starts, and nothing is written.

Why the playground does not show it

The frontend filters the skill out before every run. isUsableSkill in
web/packages/agenta-playground/src/state/execution/agentRequest.ts:138 drops any skill whose
name, description or body is blank, and its own comment says this is so the entry "can't 500 the
run". So the browser silently repairs the configuration on the way out, and every other caller
runs it as saved.

Impact

Any server-side invocation of an affected agent fails: scheduled runs, approval resumes, and any
API caller that passes references instead of a full parameters payload.

Notes

Found while testing the approvals work on #5562. Related to #5590.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions