-
Notifications
You must be signed in to change notification settings - Fork 10
fix(runner): preserve metadata when rewriting legacy aliases #1803
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
fix(runner): preserve metadata when rewriting legacy aliases #1803
Conversation
- ensure toJSONWithLegacyAliases no longer drops schema info while normalizing alias depths - add explanatory comments for the whole function - extend json-utils tests to cover regression scenario
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.
Pull Request Overview
This PR fixes a bug in the toJSONWithLegacyAliases function where schema metadata was being dropped when rewriting legacy aliases. The fix ensures that when expanding shadow ref aliases and incrementing numeric alias cells, all metadata (including schema and rootSchema) is preserved.
- Preserve metadata when expanding shadow ref aliases by using spread operator for all alias properties except cell
- Preserve metadata when incrementing numeric alias cells by spreading the entire alias object before overriding specific properties
- Add comprehensive tests to verify schema preservation in both scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/runner/src/builder/json-utils.ts | Fix metadata preservation in toJSONWithLegacyAliases and add explanatory comments |
| packages/runner/test/json-utils.test.ts | Add test coverage for schema preservation regression scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
2 issues found across 2 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="packages/runner/src/builder/json-utils.ts">
<violation number="1" location="packages/runner/src/builder/json-utils.ts:78">
Typo in comment: "is should" should be "it should" for clarity.</violation>
<violation number="2" location="packages/runner/src/builder/json-utils.ts:159">
Comment contradicts the code: the code returns the result when the object is empty, not undefined.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
Summary by cubic
Preserves schema metadata when rewriting legacy aliases in toJSONWithLegacyAliases, fixing missing tool schemas during recipe instantiation from defaults. Addresses CT-919.