task.agent used to collapse your YAML silently — a 3-agent config could run as 1. Now you get a warning by default, and an exception under PRAISONAI_VALIDATE_STRICT=true.
Why this exists
Before this validation existed, a YAML with a duplicatename: researcher on two agents ran as one agent — the second silently overwrote the first via a dict-merge collapse. A task typo like agent: reseacher (missing an r) skipped the task with no message. Both problems look like a broken run with no clear cause.
PRAISONAI_VALIDATE_STRICT=true turns those silent collapses into loud failures. In CI, prefer strict. In development, the default warning gives you the same hint without stopping the session.
Backward compatible. The default stays non-strict — validation issues warn, they don’t raise. Set
PRAISONAI_VALIDATE_STRICT=true to make them raise ValueError instead.Quick Start
1
Default (warn)
A duplicate Both entries survive; the colliding one is preserved under
name: no longer overwrites the first agent — both are kept under suffixed keys and you get a warning.researcher__dup_1 (0-based list index).2
Strict (CI)
Turn the warning into a hard failure so CI catches the config before an agent starts.
3
Unknown task agent
A task whose Under
agent: doesn’t match any defined agent warns by default, raises under strict.PRAISONAI_VALIDATE_STRICT=true:How It Works
When both
roles: and agents: are present, roles: wins for task→agent resolution.
Choosing a mode
Configuration
PRAISONAI_VALIDATE_STRICT controls whether validation issues warn or raise.
Duplicate-preserved key naming
Under the default (warn) mode, colliding entries are kept — not dropped. The duplicate is stored under a suffixed key so both survive:i is the 0-based list index of the colliding entry. A second agent named researcher at list index 1 becomes researcher__dup_1.
Grep-friendly messages
Copy these into your CI log filters:PRAISONAI_VALIDATE_STRICT=true the same conditions raise:
Best Practices
Turn on strict mode in CI
Turn on strict mode in CI
Set
PRAISONAI_VALIDATE_STRICT=true in your CI environment so a duplicate name or a task typo fails the pipeline instead of silently degrading a run. Keep the default (warn) locally so quick experiments aren’t blocked.Set true, not 1
Set true, not 1
This variable only recognises the literal string
"true" (case-insensitive). PRAISONAI_VALIDATE_STRICT=1 looks enabled but behaves as non-strict. Always use =true.Rename duplicates instead of relying on the suffix
Rename duplicates instead of relying on the suffix
The
__dup_i suffix keeps both entries so nothing is silently lost, but a name collision is almost always a mistake. Rename the second agent to silence the warning and make the config unambiguous.Fix task→agent typos at the source
Fix task→agent typos at the source
An unknown
agent: on a task means that task never runs. Match the agent: value exactly to a defined agent name — under strict mode the run stops until you do.Related
Tool Timeouts
The other silent-collapse fix: per-agent
tool_timeout now uses the tightest valueWorkflow Validation Loop
Validate inputs and outputs with retry feedback
YAML Configuration Reference
Every field for agents, tasks, and workflows
Skill Manage
Nested skill file paths and the path safety prefilter

