-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix(copilot): let edit_workflow set knowledge-base tag filters, and stop it clearing them #5546
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
Merged
+537
−110
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a405904
fix(copilot): persist KB tag subblocks as JSON strings from edit_work…
j15z b44e623
feat(copilot): expose KB tag definitions in VFS meta.json
j15z b75565c
fix(copilot): stringify KB tag subblocks on the nested-node edit path
j15z 60e6d24
refactor(copilot): tighten subblock serialization helpers
j15z b842bb0
fix(copilot): stop stripping tagFilters/documentTags from the agent's…
j15z 42a66cc
fix(copilot): reject malformed KB tag values instead of clearing the …
j15z b333a39
refactor(copilot): collapse duplicate JSON-array parsing in edit-work…
j15z 7e69f8d
feat(copilot): specify tag name and legal operators in KB meta.json
j15z e291b1f
fix(copilot): pass a nullish subblock clear through instead of serial…
j15z File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
43 changes: 43 additions & 0 deletions
43
...eId]/w/[workflowId]/components/panel/components/editor/components/sub-block/utils.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /** | ||
| * @vitest-environment node | ||
| */ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { parseJsonArrayValue } from './utils' | ||
|
|
||
| interface TagFilter { | ||
| id: string | ||
| tagName: string | ||
| } | ||
|
|
||
| describe('parseJsonArrayValue', () => { | ||
| it('parses a JSON string array, the shape edit_workflow now persists', () => { | ||
| const filters: TagFilter[] = [{ id: 'f1', tagName: 'Department' }] | ||
|
|
||
| expect(parseJsonArrayValue<TagFilter>(JSON.stringify(filters))).toEqual(filters) | ||
| }) | ||
|
|
||
| // Rows written by builds predating the edit_workflow stringify fix still hold raw arrays. | ||
| it('passes through an already-parsed array', () => { | ||
| const filters: TagFilter[] = [{ id: 'f1', tagName: 'Department' }] | ||
|
|
||
| expect(parseJsonArrayValue<TagFilter>(filters)).toEqual(filters) | ||
| }) | ||
|
|
||
| it.each([ | ||
| ['null', null], | ||
| ['undefined', undefined], | ||
| ['an empty string', ''], | ||
| ])('returns an empty array for %s', (_label, value) => { | ||
| expect(parseJsonArrayValue(value)).toEqual([]) | ||
| }) | ||
|
|
||
| it.each([ | ||
| ['a malformed JSON string', '{not json'], | ||
| ['a JSON string parsing to null', 'null'], | ||
| ['a JSON string parsing to an object', '{"a":1}'], | ||
| ['a JSON string parsing to a number', '5'], | ||
| ['a bare object', { a: 1 }], | ||
| ])('returns an empty array rather than throwing for %s', (_label, value) => { | ||
| expect(parseJsonArrayValue(value)).toEqual([]) | ||
| }) | ||
| }) |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.