Repository navigation
[backport cloud/1.57] fix(agent): define a hand-added subgraph host's definitions in the bound document (#21576) #21602
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
Merged
Changes from all commits
Commits
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
71 changes: 71 additions & 0 deletions
71
browser_tests/tests/agent/agentHumanAddedBlueprintPromotedWrite.spec.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,71 @@ | ||
| import { expect } from '@playwright/test' | ||
|
|
||
| import enMessages from '@/locales/en/main.json' with { type: 'json' } | ||
|
|
||
| import { agentConversationTest as test } from '@e2e/fixtures/agentConversationFixture' | ||
|
|
||
| test.describe( | ||
| 'Promoted widget edit on a human-added subgraph blueprint with Agent bound', | ||
| { tag: ['@cloud', '@agent', '@subgraph', '@widget', '@vue-nodes'] }, | ||
| () => { | ||
| test.use({ | ||
| conversationCase: 'agent-rec-text-only-answer', | ||
| humanOpsHost: 'apply' | ||
| }) | ||
|
|
||
| test('saves the edit to the shared document without a rejection notice', async ({ | ||
| agentConversation, | ||
| comfyPage | ||
| }) => { | ||
| test.setTimeout(90_000) | ||
|
|
||
| await test.step('replay the recorded turn', () => | ||
| agentConversation.runTurns()) | ||
|
|
||
| const hostId = | ||
| await test.step('add a blueprint that promotes its prompt', async () => { | ||
| const added = await agentConversation.addBlueprint(true, [400, 400]) | ||
| await expect( | ||
| agentConversation.vueNodes.getNodeLocator(added) | ||
| ).toBeVisible() | ||
| const outcomes = await agentConversation.waitForHumanOps(1) | ||
| expect( | ||
| outcomes.filter(({ outcome }) => outcome === 'rejected') | ||
| ).toEqual([]) | ||
| await expect | ||
| .poll(() => agentConversation.hostNodeIds()) | ||
| .toContain(added) | ||
| return added | ||
| }) | ||
|
|
||
| await test.step('edit the promoted prompt on the blueprint by hand', async () => { | ||
| const field = agentConversation.vueNodes | ||
| .getNodeLocator(hostId) | ||
| .getByLabel('text', { exact: true }) | ||
| await field.fill('an edited blueprint prompt') | ||
| await field.blur() | ||
| await agentConversation.waitForPendingFrames( | ||
| '6', | ||
| 'text', | ||
| 'blueprint edit judged' | ||
| ) | ||
| }) | ||
|
|
||
| await test.step('no rejected-edit notice is shown', async () => { | ||
| await expect | ||
| .soft( | ||
| comfyPage.toast.toastErrors.filter({ | ||
| hasText: enMessages.agent.editRejected.widgetWrite | ||
| }) | ||
| ) | ||
| .toHaveCount(0) | ||
| }) | ||
|
|
||
| await test.step('the edit reaches the shared document', async () => { | ||
| await expect | ||
| .poll(() => agentConversation.hostNode(hostId)?.widgets_values) | ||
| .toEqual(expect.arrayContaining(['an edited blueprint prompt'])) | ||
| }) | ||
| }) | ||
| } | ||
| ) |
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
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
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.
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.