feat(#4129): add agent field validation to AIResource extensions processor - #4246
feat(#4129): add agent field validation to AIResource extensions processor#4246fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
…essor Extend AIResourceExtensionsProcessor to validate agent-specific fields when spec.type is 'agent'. Add collectAgentErrors helper (following the collectOciErrors pattern) that checks: - spec.instructions: required, non-empty string - spec.handoffs / spec.tools: must be arrays if present (opaque strings accepted without entity-ref format enforcement) - spec.resetToolChoice: must be boolean if present - spec.modelSettings: must be plain object if present - spec.toolUseBehavior: must be string or string array if present - spec.outputSchema: must be string or object if present - spec.handoffDescription / spec.model: must be strings if present All errors are collected and reported together. Non-agent AiResource entities (skill, rule, model) are unaffected. Error messages name the field path and problem without exposing internal class names. Closes #4129
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4246 +/- ##
==========================================
+ Coverage 58.52% 58.54% +0.02%
==========================================
Files 2447 2448 +1
Lines 97252 97305 +53
Branches 26994 27023 +29
==========================================
+ Hits 56913 56966 +53
+ Misses 40146 40139 -7
- Partials 193 200 +7
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
johnmcollier
left a comment
There was a problem hiding this comment.
Request changes
Agent field validation landed in the wrong place relative to #4128 / #4164. Please rework this PR rather than polishing the current AIResourceExtensionsProcessor approach.
1) Follow the previous PR’s packaging approach
#4128 put agent typing in dedicated packages:
catalog-model-ai-resource-agent(types / JSON schema /KindValidator)catalog-backend-module-ai-resource-agent(catalog model registration forkind: AiResource)
Do not extend AIResourceExtensionsProcessor with agent-specific field rules. That processor should stay focused on shared RHDH extensions (spec.scope, OCI source-location).
If RHIDP-15868 still needs catalog-processor coverage beyond the existing agent KindValidator, put it in the agent backend module (matching AiResource), not in catalog-backend-module-ai-resource-extensions.
Also align kind casing with #4128 (AiResource), not AIResource.
2) Update OpenSpec to match that architecture
The current OpenSpec steered this PR incorrectly (notably D10 / tasks §5 / proposal “extend the AiResource extensions processor path”). Update the OpenSpec change materials under workspaces/ai-integrations/openspec/changes/airesource-agent-typed-schema/ so they reflect:
- Agent schema + agent ingestion validation live with the agent packages / module
AIResourceExtensionsProcessorremains scope/OCI only- Kind spelling
AiResourceconsistent with examples and the agent model
Please amend design.md, tasks.md, proposal.md, and the ai-resource-agent-ingestion spec as needed so the next coding pass cannot re-learn the wrong home.
Out of scope for this fix round
Fullsend workflow/skill changes for OpenSpec drift feedback loops — track separately.



Extend AIResourceExtensionsProcessor to validate agent-specific fields when spec.type is 'agent'. Add collectAgentErrors helper (following the collectOciErrors pattern) that checks:
accepted without entity-ref format enforcement)
All errors are collected and reported together. Non-agent AiResource entities (skill, rule, model) are unaffected. Error messages name the field path and problem without exposing internal class names.
Closes #4129
Post-script verification
agent/4129-agent-processor-validation)258cfc701b040f64cb74cb7316d749f029d09617..HEAD)