Open History to see the last commit
1import { expect, test } from '@playwright/test'
2
3/**
4 * An AG-UI `Interrupt` is a shared envelope — a workflow engine or another
5 * agent framework can put one on the same stream. Only interrupts carrying
6 * this package's resume binding are resolvable here; the rest must be visible
7 * but inert, never silently translated into a resolvable AI-domain interrupt.
8 */
9test.describe('foreign interrupts', () => {
10 test('an interrupt with no binding is unbound and unresolvable', async ({
11 page,
12 }) => {
13 await page.goto('/foreign-interrupt')
14
15 await expect(page.getByTestId('interrupt-count')).toHaveText('2')
16
17 // Ours: bound, resolvable.
18 await expect(page.getByTestId('kind-ours')).toHaveText('generic')
19 await expect(page.getByTestId('can-resolve-ours')).toHaveText('true')
20 await expect(page.getByTestId('resolve-ours')).toBeVisible()
21
22 // Theirs: no binding, so it is surfaced as unbound with no resolver.
23 await expect(page.getByTestId('kind-theirs')).toHaveText('unbound')
24 await expect(page.getByTestId('can-resolve-theirs')).toHaveText('false')
25 await expect(page.getByTestId('resolve-theirs')).toHaveCount(0)
26
27 // Still shown, so a UI can tell the user the run is paused.
28 await expect(page.getByTestId('message-theirs')).toHaveText(
29 'Approve the deployment?',
30 )
31 })
32
33 test('an unbound interrupt does not block resolving the bound one', async ({
34 page,
35 }) => {
36 await page.goto('/foreign-interrupt')
37
38 await expect(page.getByTestId('resolve-ours')).toBeVisible()
39 await page.getByTestId('resolve-ours').click()
40
41 // The continuation run happening at all proves the batch submitted with
42 // only the interrupt we own — the foreign one is excluded from the
43 // completeness gate rather than deadlocking it.
44 await expect(page.getByTestId('assistant-text')).toHaveText('resumed:ours')
45 })
46})