Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a200afb
fix(agent): load every page of Chat history
ryan-di Oct 12, 2026
44905df
test(agent): give thread-list mocks a valid empty page
ryan-di Oct 12, 2026
fef8efa
fix(agent): keep Chat history when paging ends early
ryan-di Oct 12, 2026
c2c5009
Merge remote-tracking branch 'origin/main' into ryan-di/agent-chat-hi…
ryan-di Oct 15, 2026
2f6832c
refactor(agent): remove doc comments from internal paging helpers
ryan-di Oct 15, 2026
0a6ad20
fix(agent): reject the thread list when paging stops early
ryan-di Oct 15, 2026
fcc8737
fix(agent): ignore a chat history refresh that a newer one replaced
ryan-di Oct 15, 2026
8f7c54e
test(agent): drop stale comments in history tests
ryan-di Oct 15, 2026
cfbfe46
test(agent): share one empty thread-list page across browser mocks
ryan-di Oct 15, 2026
0bbc436
test(agent): wait for the stale history page to be read
ryan-di Oct 15, 2026
e604413
fix(agent): ignore a chat history refresh from a closed panel
ryan-di Oct 15, 2026
41962f1
test(agent): drop comments in thread-list route fixtures
ryan-di Oct 15, 2026
8495f30
test(agent): cover Chat history listing a chat from a second page
ryan-di Oct 15, 2026
f75f23a
test(agent): type the paging overrides in chat history tests
ryan-di Oct 15, 2026
8325a3e
test(agent): name the non-retryable report in the incomplete-list test
ryan-di Oct 15, 2026
f29f7dd
test(agent): keep the page-2 spec to what the user sees
ryan-di Oct 15, 2026
99951ad
test(agent): type the remaining thread-list mock bodies
ryan-di Oct 15, 2026
a95ea49
refactor(agent): drop the JSDoc on AgentThreadListIncompleteError
ryan-di Oct 15, 2026
e6d9762
fix(agent): stop chat history refreshes when the panel closes
ryan-di Oct 15, 2026
3dab65a
fix(agent): keep an older chat history result when a newer refresh fails
ryan-di Oct 15, 2026
e24e329
fix(agent): tag an incomplete thread-list report with its reason
ryan-di Oct 15, 2026
c7b0642
test(agent): cover the aborted history request when the panel closes
ryan-di Oct 15, 2026
58230c4
test(agent): build the thread-list fixture pages one way
ryan-di Oct 15, 2026
5b13bbb
test(agent): drop comments above the helpers this PR changed
ryan-di Oct 15, 2026
9c83f4b
test(agent): drop the aborted-request test the stale table covers
ryan-di Oct 15, 2026
1dfcd46
test(agent): share the setup of the chat history tests
ryan-di Oct 15, 2026
d5689be
refactor(agent): name the paging stop reason
ryan-di Oct 15, 2026
e27509c
refactor(agent): pass rest.listThreads through directly
ryan-di Oct 15, 2026
6d8a450
test(agent): match the thread-list URL one way in panel tests
ryan-di Oct 15, 2026
182a61b
fix(agent): follow active workflow chat (#18402)
christian-byrne Oct 15, 2026
9811c7c
test(agent): match the paged thread list in the tab-follow tests
ryan-di Oct 15, 2026
11164ea
fix(agent): don't follow a tab the panel opens itself
ryan-di Oct 15, 2026
1b092b7
fix(agent): keep the user on the tab a followed chat opened for
ryan-di Oct 15, 2026
96a53be
fix(agent): follow the tab's newest chat only when nothing is drafted
ryan-di Oct 15, 2026
6899a8a
fix(agent): keep the open chat when a followed chat fails to open
ryan-di Oct 15, 2026
c738d84
fix(agent): follow the active tab on reopen when the target is elsewhere
ryan-di Oct 15, 2026
b17a649
test(agent): cover the draft hold-back in the tab-follow spec
ryan-di Oct 15, 2026
97ddebf
refactor(agent): drop follow comments the code already says
ryan-di Oct 15, 2026
88bdc07
fix(agent): follow only the tab changes a user makes
ryan-di Oct 15, 2026
b782b2b
fix(agent): decide each tab follow once, from the latest chat list
ryan-di Oct 15, 2026
b9ba3f2
fix(agent): keep the open chat untouched when a follow fails
ryan-di Oct 15, 2026
fcec00a
test(agent): wait out tab-follow negatives on a proven window
ryan-di Oct 15, 2026
9bfa032
test(agent): move the tab-follow spec's mocks into fixtures
ryan-di Oct 15, 2026
127d38c
test(agent): pin running turns and tab closes in the tab follow
ryan-di Oct 15, 2026
f278596
fix(agent): keep a history refresh's error when a follow re-lists mea…
ryan-di Oct 15, 2026
8b55b67
fix(agent): rank a chat by its first valid time, and last without one
ryan-di Oct 15, 2026
992e388
fix(agent): finish a follow's chat switch once its transcript is in
ryan-di Oct 15, 2026
75b4365
fix(agent): resolve a tab's workflow before re-listing its chats
ryan-di Oct 15, 2026
d02038a
fix: report a bulk tab close as one user tab change
ryan-di Oct 15, 2026
ab22f19
fix: mark the remaining user tab switches as user activations
ryan-di Oct 15, 2026
66a1b7a
refactor: drop the comments in openWorkflow
ryan-di Oct 15, 2026
6dd3a09
refactor(agent): keep the tab follow under the audit's limits
ryan-di Oct 15, 2026
9a44240
fix: report only the tab a user's close itself activated
ryan-di Oct 15, 2026
278b767
fix: treat only a route change as a user tab switch
ryan-di Oct 15, 2026
1cc46b3
fix(agent): settle a kept-open chat switch by what really happened
ryan-di Oct 15, 2026
0ff163f
fix(agent): drop a history load error once a newer list is on screen
ryan-di Oct 15, 2026
3f07296
fix(agent): keep a chat with no valid time where Chat history had it
ryan-di Oct 15, 2026
29b0d88
fix(agent): re-list a tab's chats at once when its cloud id is known
ryan-di Oct 15, 2026
0b0ac0f
fix(agent): drop the empty icon from the follow notice's Retry
ryan-di Oct 15, 2026
c6743df
Merge remote-tracking branch 'origin/main' into ryan-di/agent-chat-hi…
ryan-di Oct 16, 2026
94cbba8
feat(agent): combine workflow chat following and tab activity
ryan-di Oct 16, 2026
33a22a9
fix(agent): integrate current chat-history parent
ryan-di Oct 16, 2026
d2eabb1
test(agent): cover workflow tab chat transitions
ryan-di Oct 16, 2026
c679248
fix(agent): resolve chat history pagination conflicts with main
ryan-di Oct 19, 2026
b48a533
refactor(agent): make chat history refresh outcomes explicit
ryan-di Oct 20, 2026
93b0ce8
test: cover history cancellation on account transitions
ryan-di Oct 20, 2026
2e74800
fix(agent): restack workflow chats on current history parent
ryan-di Oct 20, 2026
4746525
test(agent): assert history activity timestamps
ryan-di Oct 20, 2026
14010ff
merge: integrate main into agent history pagination
ryan-di Oct 20, 2026
b84b8b4
chore: update workflow chat stack with latest history parent
ryan-di Oct 20, 2026
8aafac7
merge: integrate main after chat history lands
ryan-di Oct 20, 2026
1e1bdac
test(agent): strengthen workflow chat transition coverage
ryan-di Oct 20, 2026
a1eed5e
fix(agent): preserve current chat when history refresh fails
ryan-di Oct 20, 2026
3904a42
fix(agent): reconcile workflow chat tracking with main
ryan-di Oct 20, 2026
c6a9bd3
test(agent): wait for canvas before placing search nodes
ryan-di Oct 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions browser_tests/fixtures/agentConversationFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import {
import { agentReplayNodeDefs } from '@e2e/fixtures/data/agentReplayNodeDefs'
import type { ExpectedTurn } from '@e2e/fixtures/data/agent/agentConversationExpectations'
import { RECORDED_EXPECTATIONS } from '@e2e/fixtures/data/agent/agentConversationExpectations'
import { emptyAgentThreadList } from '@e2e/fixtures/data/agent/agentThreadList'
import { mockEmptyAgentThreadList } from '@e2e/fixtures/utils/agentThreadList'
import type { TabSwitchLens, WorkspaceStore } from '@e2e/types/globals'

import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute'
Expand Down Expand Up @@ -714,9 +714,7 @@ export class AgentConversationHarness {

private async mockAgentApi(): Promise<void> {
const { page } = this
await page.route('**/api/agent/threads?*', (route) =>
route.fulfill(jsonRoute(emptyAgentThreadList()))
)
await mockEmptyAgentThreadList(page)
await page.route('**/api/agent/threads/*/messages', (route) => {
const request = route.request()
if (request.method() === 'POST') {
Expand Down Expand Up @@ -917,9 +915,6 @@ export class AgentConversationHarness {
const before = new Set(await this.graphNodeIds())
await this.page.mouse.dblclick(position.x, position.y, { delay: 5 })
const dialog = this.page.getByRole('search')
// Scoped by accessible name: the seed workflow already has nodes on the
// canvas, and a widget-select trigger (e.g. LoadImage's) is also
// role="combobox", so an unnamed query resolves to more than one match.
const input = dialog.getByRole('combobox', { name: enMessages.g.addNode })
await input.waitFor({ state: 'visible' })
await input.fill('Note')
Expand All @@ -940,7 +935,12 @@ export class AgentConversationHarness {
return Boolean(ghostNode?.flags.ghost)
})

await this.page.mouse.click(position.x, position.y)
const canvasBounds = await this.comfyPage.canvas.boundingBox()
if (!canvasBounds) throw new Error('Canvas bounding box not available')
await this.comfyPage.canvasOps.click({
x: position.x - canvasBounds.x,
y: position.y - canvasBounds.y
})
const after = await this.graphNodeIds()
const [added] = after.filter((id) => !before.has(id))
if (!added) throw new Error('the search box add produced no node')
Expand Down
114 changes: 114 additions & 0 deletions browser_tests/fixtures/agentTabActivationFixture.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import { expect } from '@playwright/test'
import type { Page } from '@playwright/test'

import { agentTest, bootAgentApp } from '@e2e/fixtures/agentPanelFixture'
import { AGENT_SOCKET_URL } from '@e2e/fixtures/agentSocket'
import { AgentPanel } from '@e2e/fixtures/components/AgentPanel'
import { Topbar } from '@e2e/fixtures/components/Topbar'
import { agentComposerRunMode } from '@e2e/fixtures/data/agent/agentComposerPerformance'
import {
tabActivationChats,
tabActivationTranscriptReads
} from '@e2e/fixtures/data/agent/tabActivationChats'
import { AgentWorkflowChatsMock } from '@e2e/fixtures/helpers/agentWorkflowChats'
import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute'
import { nextFrame } from '@e2e/fixtures/utils/timing'

class TabActivationChats {
readonly panel: AgentPanel
readonly topbar: Topbar
readonly transcriptReads: string[] = []

constructor(private readonly page: Page) {
this.panel = new AgentPanel(page)
this.topbar = new Topbar(page)
}

private async refreshAfter(action: () => Promise<void>): Promise<void> {
const [response] = await Promise.all([
this.page.waitForResponse(
(response) =>
new URL(response.url()).pathname === '/api/agent/threads' &&
response.request().method() === 'GET'
),
action()
])
expect(await response.finished()).toBeNull()
await nextFrame(this.page)
}

async openChatFromHistory(title: string): Promise<void> {
await this.refreshAfter(() => this.panel.historyButton.click())
await this.refreshAfter(() =>
this.panel.root.getByRole('button', { name: title, exact: true }).click()
)
await this.waitForFollowToSettle()
}

async activateWorkflow(name: string): Promise<void> {
await this.topbar.getWorkflowTab(name).click()
await this.waitForFollowToSettle()
}

async waitForFollowToSettle(): Promise<void> {
await nextFrame(this.page)
await expect(
this.panel.root.getByTestId('agent-panel-footer')
).not.toHaveAttribute('inert')
}
}

export const tabActivationTest = agentTest.extend<{
tabChats: TabActivationChats
}>({
tabChats: async ({ page, agentFlagEnabled }, use) => {
const chats = new AgentWorkflowChatsMock(tabActivationChats)
const tabChats = new TabActivationChats(page)
const unexpectedMutations: string[] = []
await page.route(
(url) => url.pathname.startsWith('/api/'),
(route) => {
if (route.request().method() !== 'GET')
unexpectedMutations.push(
`${route.request().method()} ${new URL(route.request().url()).pathname}`
)
return route.fulfill({ status: 404, json: {} })
}
)
await page.routeWebSocket(AGENT_SOCKET_URL, () => {})
await page.routeWebSocket(/\/ws(?:\?|$)/, (ws) => {
ws.send(
JSON.stringify({
type: 'status',
data: { status: { exec_info: { queue_remaining: 0 } } }
})
)
})
await bootAgentApp(page, agentFlagEnabled, {
beforeNavigate: async (page) => {
await chats.route(page)
await page.route('**/api/agent/threads/*/messages', (route) => {
if (route.request().method() === 'GET')
tabChats.transcriptReads.push(
new URL(route.request().url()).pathname.split('/')[4]
)
return route.fallback()
})
await page.route('**/api/agent/run-mode', (route) =>
route.fulfill(jsonRoute(agentComposerRunMode))
)
await page.route('**/api/experiment/models', (route) =>
route.fulfill(jsonRoute([]))
)
await page.route('**/api/internal/cloud_analytics', (route) =>
route.fulfill({ status: 204 })
)
}
})
await tabChats.panel.open()
await use(tabChats)
await tabChats.waitForFollowToSettle()
expect(tabChats.transcriptReads).toEqual(tabActivationTranscriptReads)
expect(unexpectedMutations).toEqual([])
}
})
Loading
Loading