Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: resolve toolbox $ref config before deploy #9148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: resolve toolbox $ref config before deploy #9148
Changes from all commits
bbf9e11ba1d6beFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResolveFileRefsalready returns a structured*azdext.LocalError(pkg/foundry/errors.go). This extension'sAGENTS.mderror rule says not to wrap an already-structured error withfmt.Errorf("...: %w"): during gRPC serialization azd keeps the inner message/code/category and drops the outer text, so theresolving toolbox service %q configcontext never reaches the user. Return the structured error unchanged, or fold the toolbox name into a fresh structured error.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
containsToolboxFileRefmatches a$refkey at any depth, andResolveFileRefsthen resolves every one as a local file, tool payloads included.openapiis a supported tool type (schemas/azure.ai.toolbox.jsonline 27; tool items areadditionalProperties: true), and OpenAPI documents carry JSON-pointer refs such as#/components/schemas/Foo. InrefTargetPaththat value isn't a URL and isn't absolute, so it gets joined onto the project root andloadRefFilefails with "cannot read $ref file". Those payloads marshalled through verbatim before this change, so a tool that carries any non-file$refwould now fail to deploy, even when the config has no file include. Consider scoping resolution to the include points you actually support (the service entry and deployment items) and add a regression test for a tool payload that carries a non-file$ref; the new test only covers the file-include happy path.Uh oh!
There was an error while loading. Please reload this page.