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 2 commits 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❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4246 +/- ##
==========================================
+ Coverage 58.52% 58.54% +0.02%
==========================================
Files 2447 2449 +2
Lines 97252 97317 +65
Branches 26994 27025 +31
==========================================
+ Hits 56913 56977 +64
+ Misses 40146 40140 -6
- 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.
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 8:28 PM UTC · Completed 8:46 PM UTC Commit: |
Move collectAgentErrors and agent field validation out of AIResourceExtensionsProcessor into catalog-backend-module-ai-resource-agent as AiResourceAgentProcessor, matching the packaging approach from #4128. - Remove agent-specific code from AIResourceExtensionsProcessor (scope/OCI only) - Add AiResourceAgentProcessor to catalog-backend-module-ai-resource-agent - Register processor alongside model source in the agent backend module - Update OpenSpec design.md, tasks.md, proposal.md to reflect architecture - Align kind casing with AiResource (matching #4128) Addresses review feedback on #4246 Assisted-by: Claude Code
🔧 Fix agent — iteration 1 (human-triggered)Addressed all 4 review findings. Moved agent field validation from AIResourceExtensionsProcessor to a new AiResourceAgentProcessor in catalog-backend-module-ai-resource-agent. Updated OpenSpec documents (design.md, tasks.md, proposal.md) to reflect the correct architecture. All tests pass (102 tests across both packages). Fixed (4):
Tests: passed Decision points
Updated by fullsend fix agent |
|
|
/fs-review |
1 similar comment
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 9:53 PM UTC · Completed 10:10 PM UTC Commit: |
ReviewFindingsMedium
Low
|
johnmcollier
left a comment
There was a problem hiding this comment.
Second review pass
Architecture move looks right: agent field validation now lives in catalog-backend-module-ai-resource-agent as AiResourceAgentProcessor (alongside the agent model), and AIResourceExtensionsProcessor stays scope/OCI-only. That packaging split is intentional — not a problem to reverse.
Please address the remaining actionable items from the bot review (and stale PR metadata):
1) Update PR title
Current title still says “add agent field validation to AIResource extensions processor.” Update to something accurate, e.g.:
feat(#4129): add AiResourceAgentProcessor for agent field validation
2) Add package README
Add workspaces/ai-integrations/plugins/catalog-backend-module-ai-resource-agent/README.md documenting:
- what the module registers (agent catalog model +
AiResourceAgentProcessor) - that it targets
kind: AiResource/spec.type: agent - which agent fields are validated (mirror the processor JSDoc / sibling extensions README style)
- that shared RHDH extensions (scope / OCI) remain in
catalog-backend-module-ai-resource-extensions
3) Refresh PR description
Replace the body that still describes extending AIResourceExtensionsProcessor. Briefly note:
- validation lives in the agent backend module (same packaging approach as #4128)
- OpenSpec (
airesource-agent-typed-schema) was updated to match - extensions processor is unchanged for agent fields
Do not change
- Whitespace-only
instructions/ array element-type checks — leave as intentional schema/processor layering - Do not move validation back into
AIResourceExtensionsProcessor



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)