feat(#4128): add AiResource agent typed schema - #4164
feat(#4128): add AiResource agent typed schema#4164fullsend-ai-coder[bot] wants to merge 4 commits into
Conversation
Add AgentAiResourceEntityV1alpha1 types, KindValidator, type guard, JSON schema, example fixtures, and unit tests for the agent-shaped AiResource entity (spec.type: 'agent'). Implementation follows the upstream skill/rule discriminated-union pattern from @backstage/catalog-model. Agent entities require spec.instructions (non-empty string) and support optional fields per the design D3 mapping: handoffDescription, model, handoffs, tools, toolUseBehavior, resetToolChoice, modelSettings (temperature, maxTokens, toolChoice), and outputSchema. Changes: - plugins/ai-experience-common/src/agent/: new AgentAiResource types, validator, type guard, and JSON schema - examples/ai-resource-agents.yaml: router + specialist multi-agent handoff example demonstrating required and optional fields - examples/ai-resources-oci-skills.yaml: fix plural spec.type 'skills' -> 'skill' (D8) - app-config.yaml: wire agent example into catalog locations - report.api.md: regenerated with new public exports No @openai/agents-core dependency; opaque string[] for handoffs/tools (no entity-ref format enforcement). Closes #4128 Assisted-by: Claude Opus 4.6
|
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 3:26 PM UTC · Completed 3:41 PM UTC |
ReviewFindingsMedium
Low
|
johnmcollier
left a comment
There was a problem hiding this comment.
Requested changes
Please land the agent typed schema in a dedicated package (not ai-experience-common), wire catalog-model registration in this PR, and address the inline notes below.
Also required (no diff hunk)
- Fix remaining plural drift:
workspaces/ai-integrations/examples/ai-resource-oci.yamlstill hasspec.type: skills— upstream/discriminator is singularskill. - Add a minor changeset for the new package (workspace packages are still 0.x).
Out of scope
- Catalog processor validation (#4129 / RHIDP-15868).
|
/fs-fix address review comments |
|
🤖 Finished Fix · ✅ Success · Started 11:29 PM UTC · Completed 11:52 PM UTC |
…tration - Move types, JSON schema, KindValidator, type guard, and tests from ai-experience-common into new catalog-model-ai-resource-agent package - Remove open index signature from AgentAiResourceModelSettings (use type alias for implicit JsonObject compat) to match closed JSON schema - Add agentAiResourceEntityModel CatalogModelLayer with specType 'agent' - Add catalog-backend-module-ai-resource-agent backend module that registers the agent model source via catalogModelExtensionPoint - Wire backend module into packages/backend - Fix remaining plural drift: spec.type 'skills' → 'skill' in examples/ai-resource-oci.yaml - Add minor changeset for new packages - Regenerate API reports Addresses review feedback on #4164 Assisted-by: Claude Opus 4.6
🔧 Fix agent — iteration 1 (human-triggered)Addressed all 6 review findings. Moved agent schema to dedicated catalog-model-ai-resource-agent package, fixed schema/type mismatch by removing index signature (using type alias for JsonObject compat), added CatalogModelLayer + backend module for catalog registration, fixed plural drift in ai-resource-oci.yaml, and added minor changeset. Fixed (6):
Tests: passed Decision points
Updated by fullsend fix agent |
|
/fs-fix address failing CI check and resolve GitHub review comments that have been addressed |
|
🤖 Finished Fix · ✅ Success · Started 7:24 PM UTC · Completed 7:40 PM UTC |
Add the required `pluginPackages` array to the backstage metadata in catalog-model-ai-resource-agent/package.json. This fixes the `backstage-cli repo fix --check --publish` CI gate. Addresses review feedback on #4164 Assisted-by: Claude Opus 4.6
🔧 Fix agent — iteration 2 (human-triggered)Fixed CI publish check by adding missing Fixed (5):
Tests: passed Updated by fullsend fix agent |
- Add missing technical-specialist-agent entity to examples (issue 1) - Add module smoke test for catalog-backend-module-ai-resource-agent (issue 2) - Add minLength: 1 to handoffDescription schema field (issue 3) Signed-off-by: John Collier <jcollier@redhat.com> Assisted-by: Claude Sonnet 4.6
|
|
/fs-fix address my review comments |
|
🤖 Finished Fix · ✅ Success · Started 6:26 PM UTC · Completed 6:45 PM UTC Commit: |
🔧 Fix agent — iteration 3 (human-triggered)Verified all 6 review findings from johnmcollier are addressed. Agent types are in a dedicated catalog-model-ai-resource-agent package (not ai-experience-common). Index signature removed from AgentAiResourceModelSettings. CatalogModelLayer and backend module are implemented and wired into packages/backend. Public exports come from the dedicated package. Plural drift fixed in both YAML files. Changeset exists. All 26 tests pass, both packages build, lint clean, API reports current. Fixed (6):
Tests: passed
Decision points
Updated by fullsend fix agent |



Add AgentAiResourceEntityV1alpha1 types, KindValidator, type guard, JSON schema, example fixtures, and unit tests for the agent-shaped AiResource entity (spec.type: 'agent').
Implementation follows the upstream skill/rule discriminated-union pattern from @backstage/catalog-model. Agent entities require spec.instructions (non-empty string) and support optional fields per the design D3 mapping: handoffDescription, model, handoffs, tools, toolUseBehavior, resetToolChoice, modelSettings (temperature, maxTokens, toolChoice), and outputSchema.
Changes:
validator, type guard, and JSON schema
handoff example demonstrating required and optional fields
'skills' -> 'skill' (D8)
No @openai/agents-core dependency; opaque string[] for handoffs/tools (no entity-ref format enforcement).
Assisted-by: Claude Opus 4.6
Closes #4128
Post-script verification
agent/4128-airesource-agent-schema)bb5785cf9f6139b82812b9825cf35738d216944b..HEAD)