semantic-editing: Fix references in methods#25484
Merged
taylorsw04 merged 9 commits intomicrosoft:mainfrom Sep 18, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where references to schema types in exposed methods would be converted to void in the types shown to agents. The fix involves updating the type generation system to properly track and include referenced types from method bindings. The changes also simplify the instanceOf utility by removing unnecessary caching optimizations.
- Fixes bug where method parameter/return types were being converted to void instead of preserving schema type references
- Removes caching optimization from
instanceOffunction and simplifies its implementation - Updates the type generation system to track and include types referenced by exposed methods
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/framework/tree-agent/src/utils.ts | Removes caching from instanceOf function and adds error handling for unsupported zod effects |
| packages/framework/tree-agent/src/typeGeneration.ts | Updates type generation to track referenced types from methods and iterate over multiple schemas |
| packages/framework/tree-agent/src/test/systemPrompt.spec.ts | Adds test for method return types and refactors test helper |
| packages/framework/tree-agent/src/methodBinding.ts | Updates ExposedMethods interface to track referenced types and provides instanceOf method |
| packages/framework/tree-agent/src/index.ts | Removes instanceOf from exports |
| packages/framework/tree-agent/api-report/tree-agent.alpha.api.md | Updates API to reflect instanceOf removal from exports and BindableSchema type changes |
alexvy86
reviewed
Sep 18, 2025
alexvy86
reviewed
Sep 18, 2025
alexvy86
reviewed
Sep 18, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…sw04/FluidFramework into fix-references-in-methods
Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
…sw04/FluidFramework into fix-references-in-methods
Contributor
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
noencke
reviewed
Sep 18, 2025
| */ | ||
| function generateEditTypes( | ||
| schema: SimpleTreeSchema, | ||
| schemas: Iterable<SimpleTreeSchema>, |
Contributor
There was a problem hiding this comment.
nit: Iterable<SimpleTreeSchema> is probably the "most correct" type here, but might just be simpler to use an array SimpleTreeSchema[] since it's common/familiar.
noencke
approved these changes
Sep 18, 2025
anthony-murphy-agent
pushed a commit
to anthony-murphy-agent/FluidFramework
that referenced
this pull request
Jan 14, 2026
## Description This PR fixes a bug in which references to schema types in exposed methods would be converted to void in the types shown to the agent. It also cleans up some code and removes some unnecessary optimizations in the type string generation. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR fixes a bug in which references to schema types in exposed methods would be converted to void in the types shown to the agent. It also cleans up some code and removes some unnecessary optimizations in the type string generation.