Skip to content

fix: validate resolved agent definition kinds#9264

Merged
huimiu merged 1 commit into
mainfrom
hui/fix-agent-definition-kinds
Jul 23, 2026
Merged

fix: validate resolved agent definition kinds#9264
huimiu merged 1 commit into
mainfrom
hui/fix-agent-definition-kinds

Conversation

@huimiu

@huimiu huimiu commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fixes: #9268

Why

Doctor now validates agent services through the shared definition resolver. That resolver returned success for every resolved kind other than hosted, so an inline or $ref definition with an unsupported kind could make doctor report a false pass. Valid workflow definitions are supported but intentionally remain non-hosted.

Approach

Validate resolved non-hosted definitions with the existing agent-definition validator before returning success, while keeping the hosted conversion and service-config validation path unchanged. This keeps supported kinds in one source of truth, preserves workflow behavior, and fixes doctor without adding separate validation logic there.

Regression coverage verifies invalid inline and referenced kinds, valid workflow handling, and doctor's failure result for an invalid inline kind.

Tests

  • go test ./internal/project ./internal/cmd/doctor

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jul 23, 2026
@huimiu huimiu added the area/extensions Extensions (general) label Jul 23, 2026
@huimiu
huimiu marked this pull request as ready for review July 23, 2026 02:50
Copilot AI review requested due to automatic review settings July 23, 2026 02:50
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Validates resolved agent definition kinds through the shared validator, preventing false passes while preserving workflow support.

Changes:

  • Validates non-hosted and hosted resolved definitions consistently.
  • Adds inline, referenced, workflow, and doctor regression coverage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/project/agent_definition.go Centralizes resolved definition validation.
internal/project/agent_definition_test.go Covers supported and unsupported resolved kinds.
internal/cmd/doctor/checks_project_test.go Verifies doctor rejects invalid inline kinds.

@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag @RickWinter and @kristenwomack to let us know.

@huimiu

huimiu commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

/check-enforcer override

@huimiu
huimiu enabled auto-merge (squash) July 23, 2026 03:17
@huimiu
huimiu merged commit b1d1ddf into main Jul 23, 2026
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/extensions Extensions (general) ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate resolved agent definition kinds

3 participants