Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f4639d8
fix(load3d): reload model and refresh capture cache on agent-driven m…
ampagent Sep 12, 2026
d8a843e
fix(load3d): keep model configuration idempotent
christian-byrne Sep 16, 2026
16cd655
fix(load3d): clear remotely emptied models
christian-byrne Sep 16, 2026
821df48
test(load3d): cover agent-driven capture refresh
christian-byrne Sep 16, 2026
a4746df
test(load3d): make agent regression CI-safe
christian-byrne Sep 17, 2026
a392630
test(load3d): preserve NodeId contract in browser assertion
christian-byrne Sep 17, 2026
2c5b271
Merge remote-tracking branch 'comfyorg/main' into fix/lin-pm-1011-c17…
christian-byrne Sep 17, 2026
a222629
test(load3d): use valid model fixtures in agent regression
christian-byrne Sep 17, 2026
71cd26d
test(load3d): use the shared testing Pinia
christian-byrne Sep 17, 2026
6672293
refactor(load3d): remove redundant widget value cast
christian-byrne Sep 17, 2026
b1b29c3
Merge remote-tracking branch 'origin/main' into pr-17537
christian-byrne Sep 17, 2026
976429f
fix(load3d): renew remote subscription after re-registration
christian-byrne Sep 17, 2026
145fa79
test(load3d): compare captured image bytes
christian-byrne Sep 17, 2026
d33e062
Merge remote-tracking branch 'origin/main' into pr-17537
christian-byrne Sep 17, 2026
54e0eb2
fix(load3d): detach remote listener after node removal
christian-byrne Sep 17, 2026
cb47915
test(load3d): assert ignored updates preserve state
christian-byrne Sep 17, 2026
9838a74
test(load3d): use typed partial test doubles
christian-byrne Sep 17, 2026
fce3a44
refactor(load3d): bind widget reactions to viewer lifecycle
christian-byrne Sep 17, 2026
847d9a2
test(load3d): fuzz reactive model sequences
christian-byrne Sep 17, 2026
49049d6
test(load3d): kill deferred invalidation mutation
christian-byrne Sep 17, 2026
aae454b
test(load3d): cover reactive cleanup replacement
christian-byrne Sep 17, 2026
082409b
test(load3d): flush reactive work without timers
christian-byrne Sep 17, 2026
ee167d9
test(load3d): prove viewer teardown stops reactions
christian-byrne Sep 17, 2026
6a015cf
fix(load3d): await pending model load before scene capture
christian-byrne Sep 18, 2026
5dcc762
refactor(load3d): make clearConfigurationCleanup private
christian-byrne Sep 18, 2026
e351a1d
test(load3d): pin Load3DConfiguration reactive widget contract
christian-byrne Sep 18, 2026
c986009
test(load3d): drive agent model swaps through the follower boundary
christian-byrne Sep 18, 2026
8b1d4d7
test(load3d): drop the timing window and generated oracle from the ag…
jtydhr88 Sep 18, 2026
b2128ee
fix(load3d): publish accepted load tail synchronously
christian-byrne Sep 18, 2026
46b4218
test(agent): share follower host socket fixture
christian-byrne Sep 18, 2026
8030003
test(load3d): keep browser oracle deterministic
christian-byrne Sep 18, 2026
3ed056b
fix: keep clear ordered with pending Load3D loads
christian-byrne Sep 18, 2026
bf07ea9
test: consolidate reactive Load3D configuration cases
christian-byrne Sep 18, 2026
7bbccea
test: call follower host socket directly
christian-byrne Sep 18, 2026
b6d37d7
test: collapse Load3D capture fixture operation
christian-byrne Sep 18, 2026
7742ba8
test: iterate Load3D model assets without assertion
christian-byrne Sep 18, 2026
8cb6ef2
test: type the mutable Load3D model fixture
christian-byrne Sep 18, 2026
84e98ef
test: keep stale Load3D clear assertion behavioral
christian-byrne Sep 18, 2026
73a068f
fix: retry stale Load3D scene captures
christian-byrne Sep 18, 2026
6083383
fix: suppress effects from stale Load3D loads
christian-byrne Sep 18, 2026
7224a8b
fix(load3d): centralize scene revision invalidation
christian-byrne Sep 18, 2026
deee56d
fix(load3d): gate stale load side effects
christian-byrne Sep 18, 2026
e0eb66d
refactor(load3d): narrow pending load type
christian-byrne Sep 18, 2026
9d0f15d
fix(load3d): complete viewer setup before the first standalone load
christian-byrne Sep 18, 2026
d2010ca
Merge remote-tracking branch 'origin/main' into fix/lin-pm-1011-c17-l…
christian-byrne Sep 18, 2026
480c2d6
fix(load3d): keep camera snapshot from dirtying the scene and bound s…
christian-byrne Sep 18, 2026
1c80094
test: cover remaining Load3D stale state paths
ampagent Sep 19, 2026
8061733
test: expect unstable Load3D capture to fail closed
ampagent Sep 19, 2026
29835d5
fix: fail closed on stale Load3D state
ampagent Sep 19, 2026
7cd6605
fix: name Load3D capture diagnostic
ampagent Sep 19, 2026
3ae8880
refactor(load3d): tighten widget configuration types
ampagent Sep 19, 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
84 changes: 15 additions & 69 deletions browser_tests/fixtures/agentConversationFixture.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Locator, Page, WebSocketRoute } from '@playwright/test'
import type { Locator, Page } from '@playwright/test'
import { expect } from '@playwright/test'
import { z } from 'zod'

Expand All @@ -14,12 +14,11 @@ import type {
AgentMessages,
AgentWsEvent
} from '@/workbench/extensions/agent/schemas/agentApiSchema'
import { parseServerDocFrame } from '@/workbench/extensions/agent/crdt/docFrameClient'
import { parseAgentWsEvent } from '@/workbench/extensions/agent/schemas/agentApiSchema'

import { agentTest, bootAgentApp } from '@e2e/fixtures/agentPanelFixture'
import { HostDoc } from '@e2e/fixtures/agentConversationHostDoc'
import type { HostFrame } from '@e2e/fixtures/agentConversationHostDoc'
import { AgentFollowerHostSocket } from '@e2e/fixtures/agentFollowerHostSocket'
import { VueNodeHelpers } from '@e2e/fixtures/VueNodeHelpers'
import { TestIds } from '@e2e/fixtures/selectors'
import type {
Expand All @@ -39,7 +38,6 @@ const turnId = (turn: number): string =>
`0c5b1e77-2d4a-4f9e-8b63-1a2c3d4e5${turn.toString(16).padStart(3, '0')}`
const SOCKET_SID = '7d1f2e3a-4b5c-4d6e-8f90-1a2b3c4d5e6f'
const PANEL_MOUNT_TIMEOUT = 30_000
const SUBSCRIBE_TIMEOUT = 15_000
const CANCEL_TIMEOUT = 10_000

const OPEN_AGENT_LABEL = enMessages.agent.askComfyAgent
Expand Down Expand Up @@ -140,21 +138,16 @@ class AgentConversationHarness {
readonly vueNodes: VueNodeHelpers

private readonly host: HostDoc
private readonly hostSocket: AgentFollowerHostSocket
private readonly streams: Locator
private readonly summaries: Locator
// Every node id the host has held so far, seed included.
private readonly seenIds: Set<string>
private readonly expectations: ExpectedTurn[]
private socket: WebSocketRoute | null = null
private postedTurns = 0
private subscribes = 0
private readonly displayNames = new Map<string, string>()
// Resolved when the panel cancels the turn the recording stopped.
private readonly cancelWaiters = new Map<string, () => void>()
private resolveSubscribed: (() => void) | null = null
private readonly subscribed = new Promise<void>((resolve) => {
this.resolveSubscribed = resolve
})

constructor(
private readonly page: Page,
Expand All @@ -164,6 +157,12 @@ class AgentConversationHarness {
) {
const { workflow } = conversation
this.host = new HostDoc(workflow.id, workflow.seed, workflow.catalog)
this.hostSocket = new AgentFollowerHostSocket(
page,
workflow.id,
this.host,
SOCKET_SID
)
this.seenIds = new Set(workflow.seed.nodes.map((node) => String(node.id)))
const expectations = RECORDED_EXPECTATIONS[caseId]
const recorded = expectations?.length ?? 0
Expand All @@ -180,20 +179,7 @@ class AgentConversationHarness {

async boot(agentFlag: boolean): Promise<void> {
await this.mockAgentApi()
// The follower re-drives a pending subscribe only on a status frame, which every real connect sends.
await this.page.routeWebSocket(/\/ws/, (socket) => {
this.socket = socket
socket.onMessage((raw) => this.onClientFrame(raw))
socket.send(
JSON.stringify({
type: 'status',
data: {
status: { exec_info: { queue_remaining: 0 } },
sid: SOCKET_SID
}
})
)
})
await this.hostSocket.install()
const objectInfo = this.page.waitForResponse((response) =>
new URL(response.url()).pathname.endsWith('/api/object_info')
)
Expand Down Expand Up @@ -290,10 +276,11 @@ class AgentConversationHarness {
await new Promise((resolve) =>
setTimeout(resolve, entry.at_ms! - (Date.now() - startedAt))
)
if (entry.kind === 'event') this.send(this.stampTurn(entry.event, turn))
if (entry.kind === 'event')
this.hostSocket.send(this.stampTurn(entry.event, turn))
else {
await this.waitForSubscribe()
this.send(this.host.apply(entry.ops))
await this.hostSocket.waitForSubscribe()
this.hostSocket.send(this.host.apply(entry.ops))
for (const id of Object.keys(this.host.graph().nodes))
this.seenIds.add(id)
}
Expand Down Expand Up @@ -593,51 +580,10 @@ class AgentConversationHarness {
return parsed.data
}

private send(frame: AgentWsEvent | HostFrame): void {
// Every host frame must satisfy production's own parser, so a host that
// stopped emitting a required field fails here, not silently on the client.
if (
(frame.type.startsWith('doc_') || frame.type === 'awareness') &&
parseServerDocFrame(frame) === null
)
throw new Error(`host frame ${frame.type} is not a valid doc frame`)
if (!this.socket) throw new Error('the app has not opened /ws yet')
this.socket.send(JSON.stringify(frame))
}

private onClientFrame(raw: string | Buffer): void {
const frame: unknown = JSON.parse(raw.toString())
if (typeof frame !== 'object' || frame === null) return
const { type, data } = frame as { type?: unknown; data?: unknown }
if (type !== 'doc_subscribe' || typeof data !== 'object' || data === null)
return
const { workflow_id, state_vector_b64 } = data as {
workflow_id?: unknown
state_vector_b64?: unknown
}
if (
workflow_id !== this.conversation.workflow.id ||
typeof state_vector_b64 !== 'string'
)
return
this.send(this.host.subscribed())
this.send(this.host.catchUp(state_vector_b64))
this.subscribes += 1
this.resolveSubscribed?.()
}

// Rises once per follower subscribe; a tab return re-subscribes and the
// host answers with the catch-up frame this counter has just sent.
subscribeCount(): number {
return this.subscribes
}

private waitForSubscribe(): Promise<void> {
return withTimeout(
this.subscribed,
SUBSCRIBE_TIMEOUT,
'the follower never subscribed to the conversation workflow; graph_ops need an agent_active_tab (or a bound tab) first'
)
return this.hostSocket.subscribeCount()
}
}

Expand Down
96 changes: 96 additions & 0 deletions browser_tests/fixtures/agentFollowerHostSocket.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import type { Page, WebSocketRoute } from '@playwright/test'

import { parseServerDocFrame } from '@/workbench/extensions/agent/crdt/docFrameClient'
import type { AgentWsEvent } from '@/workbench/extensions/agent/schemas/agentApiSchema'
import { parseAgentWsEvent } from '@/workbench/extensions/agent/schemas/agentApiSchema'

import type { HostDoc, HostFrame } from '@e2e/fixtures/agentConversationHostDoc'

const SUBSCRIBE_TIMEOUT = 15_000

/** Routed `/ws` host shared by black-box Agent follower fixtures. */
export class AgentFollowerHostSocket {
private socket: WebSocketRoute | null = null
private subscribes = 0
private resolveSubscribed: (() => void) | null = null
private readonly subscribed = new Promise<void>((resolve) => {
this.resolveSubscribed = resolve
})

constructor(
private readonly page: Page,
private readonly workflowId: string,
private readonly host: HostDoc,
private readonly socketSid: string
) {}

async install(): Promise<void> {
await this.page.routeWebSocket(/\/ws/, (socket) => {
this.socket = socket
socket.onMessage((raw) => this.onClientFrame(raw))
socket.send(
JSON.stringify({
type: 'status',
data: {
status: { exec_info: { queue_remaining: 0 } },
sid: this.socketSid
}
})
)
})
}

send(frame: AgentWsEvent | HostFrame): void {
if (frame.type.startsWith('doc_') || frame.type === 'awareness') {
if (parseServerDocFrame(frame) === null)
throw new Error(`host frame ${frame.type} is not a valid doc frame`)
} else if (!parseAgentWsEvent(frame).success) {
throw new Error(`agent event ${frame.type} is not a valid agent event`)
}
if (!this.socket) throw new Error('the app has not opened /ws yet')
this.socket.send(JSON.stringify(frame))
}

async waitForSubscribe(): Promise<void> {
let timer: ReturnType<typeof setTimeout> | undefined
const timeout = new Promise<never>((_, reject) => {
timer = setTimeout(
() =>
reject(
new Error(
`the follower never subscribed to workflow ${this.workflowId}`
)
),
SUBSCRIBE_TIMEOUT
)
})
try {
await Promise.race([this.subscribed, timeout])
} finally {
clearTimeout(timer)
}
}

private onClientFrame(raw: string | Buffer): void {
const frame: unknown = JSON.parse(raw.toString())
if (typeof frame !== 'object' || frame === null) return
const { type, data } = frame as { type?: unknown; data?: unknown }
if (type !== 'doc_subscribe' || typeof data !== 'object' || data === null)
return
const { workflow_id, state_vector_b64 } = data as {
workflow_id?: unknown
state_vector_b64?: unknown
}
if (workflow_id !== this.workflowId || typeof state_vector_b64 !== 'string')
return
this.send(this.host.subscribed())
this.send(this.host.catchUp(state_vector_b64))
this.subscribes += 1
this.resolveSubscribed?.()
}

/** Rises once per follower subscribe, after the catch-up frame was sent. */
subscribeCount(): number {
return this.subscribes
}
}
Loading
Loading