Repository navigation
fix(agent): re-attach to the running turn when a send is refused (FE-1998) #19901
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
Changes from all commits
9c4fe5c
fb5eb89
a92a509
90e8574
6359e9c
c450ab0
d0e5a9f
2e55a64
96401ec
eab5068
1dc423d
58039f8
f7c62a2
ac9f260
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,53 @@ | ||||||
| import { expect } from '@playwright/test' | ||||||
|
|
||||||
| import { agentTurnLockTest as test } from '@e2e/fixtures/agentTurnLockFixture' | ||||||
|
|
||||||
| test.use({ connectWebSocketToServer: false }) | ||||||
| test.describe.configure({ timeout: 120_000 }) | ||||||
|
|
||||||
| test.describe( | ||||||
| 'a send refused because another client holds the thread', | ||||||
| { tag: ['@cloud', '@ui'] }, | ||||||
| () => { | ||||||
| test('re-attaches to the running turn and offers Stop instead of a dead end', async ({ | ||||||
| turnLock | ||||||
| }) => { | ||||||
| await turnLock.openOnBlankWorkflow() | ||||||
| const live = await turnLock.liveSocket() | ||||||
| await turnLock.startTurn('add an audio output node') | ||||||
| turnLock.finishTurn(live) | ||||||
| await expect(turnLock.sendButton).toBeVisible() | ||||||
|
|
||||||
| await test.step('another client starts a turn on the same thread', async () => { | ||||||
| turnLock.lockThreadFromAnotherClient('run it again') | ||||||
| await expect(turnLock.sendButton).toBeVisible() | ||||||
| }) | ||||||
|
|
||||||
| await test.step('the refused send re-attaches rather than dead-ending', async () => { | ||||||
| await turnLock.composer.fill('and now add a save node') | ||||||
| await turnLock.sendButton.click() | ||||||
|
|
||||||
| await expect.poll(() => turnLock.rejectedPosts()).toBe(1) | ||||||
| await expect(turnLock.stopButton).toBeVisible({ timeout: 20_000 }) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed and the deviation is deliberate, so flagging rather than resolving. I took the second option you offered instead of dropping the bounds, because measuring it turned up a second problem: the happy path runs 10.2s locally against that 15s budget, so the spec was already spending two thirds of it on a passing run, with the reattach's own 5s Happy to drop both bounds instead if you would rather the spec not carry explicit timeouts — say so and I will.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in |
||||||
| await expect(turnLock.sendButton).toHaveCount(0) | ||||||
| await expect(turnLock.liveProgressRow).toBeVisible() | ||||||
| await expect(turnLock.panel.getByText('run it again')).toBeVisible() | ||||||
| await expect(turnLock.turnInProgressNotice).toBeVisible() | ||||||
| }) | ||||||
|
|
||||||
| await test.step('stopping it unlocks the composer and the retry is accepted', async () => { | ||||||
| const foreignTurnCancelled = turnLock.waitForForeignTurnCancellation() | ||||||
| await turnLock.stopButton.click() | ||||||
| await foreignTurnCancelled | ||||||
| turnLock.finishForeignTurn(live) | ||||||
|
|
||||||
| await expect(turnLock.sendButton).toBeVisible({ timeout: 20_000 }) | ||||||
| await turnLock.composer.fill('and now add a save node') | ||||||
| await turnLock.sendButton.click() | ||||||
|
|
||||||
| await expect.poll(() => turnLock.postAttempts()).toBe(3) | ||||||
| expect(turnLock.rejectedPosts()).toBe(1) | ||||||
| }) | ||||||
| }) | ||||||
| } | ||||||
| ) | ||||||
Uh oh!
There was an error while loading. Please reload this page.