Skip to content

feat(#4129): add agent field validation to AIResource extensions processor - #4246

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/4129-agent-processor-validation
Open

feat(#4129): add agent field validation to AIResource extensions processor#4246
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/4129-agent-processor-validation

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

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

Post-script verification

  • Branch is not main/master (agent/4129-agent-processor-validation)
  • Secret scan passed (gitleaks — 258cfc701b040f64cb74cb7316d749f029d09617..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

…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
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Aug 10, 2026
@rhdh-gh-app

rhdh-gh-app Bot commented Aug 10, 2026

Copy link
Copy Markdown

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-catalog-backend-module-ai-resource-extensions

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-catalog-backend-module-ai-resource-extensions workspaces/ai-integrations/plugins/catalog-backend-module-ai-resource-extensions none v0.3.0

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.54%. Comparing base (258cfc7) to head (8ab4eee).
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from 258cfc7
ai-integrations 72.12% <100.00%> (+2.36%) ⬆️
app-defaults 69.79% <ø> (ø) Carriedforward from 258cfc7
augment 46.67% <ø> (ø) Carriedforward from 258cfc7
boost 77.63% <ø> (ø) Carriedforward from 258cfc7
bulk-import 72.79% <ø> (ø) Carriedforward from 258cfc7
cost-management 13.55% <ø> (ø) Carriedforward from 258cfc7
dcm 67.21% <ø> (ø) Carriedforward from 258cfc7
extensions 56.59% <ø> (ø) Carriedforward from 258cfc7
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 258cfc7
global-header 66.50% <ø> (ø) Carriedforward from 258cfc7
homepage 47.59% <ø> (ø) Carriedforward from 258cfc7
install-dynamic-plugins 59.95% <ø> (ø) Carriedforward from 258cfc7
intelligent-assistant 75.24% <ø> (ø) Carriedforward from 258cfc7
konflux 91.98% <ø> (ø) Carriedforward from 258cfc7
lightspeed 69.02% <ø> (ø) Carriedforward from 258cfc7
mcp-integrations 83.40% <ø> (ø) Carriedforward from 258cfc7
orchestrator 68.10% <ø> (ø) Carriedforward from 258cfc7
quickstart 63.74% <ø> (ø) Carriedforward from 258cfc7
sandbox 79.56% <ø> (ø) Carriedforward from 258cfc7
scorecard 86.23% <ø> (ø) Carriedforward from 258cfc7
theme 88.77% <ø> (ø) Carriedforward from 258cfc7
translations 5.12% <ø> (ø) Carriedforward from 258cfc7
x2a 79.20% <ø> (ø) Carriedforward from 258cfc7

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 258cfc7...8ab4eee. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Agent PR ready for human review workspace/ai-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ai-integrations: catalog processor validation for AiResource agent type

0 participants