Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4712bb8
Harden reply asset loading and previews
christian-byrne Aug 30, 2026
b4292fb
fix: preserve persisted model thumbnails
christian-byrne Aug 31, 2026
c2c3348
fix(load3d): cancel in-flight loads on disposal
christian-byrne Sep 1, 2026
ac7df82
fix(load3d): bound thumbnail generation lifecycle
christian-byrne Sep 1, 2026
d38ab63
test(load3d): verify persisted thumbnail bytes
christian-byrne Sep 1, 2026
2c2724b
fix(agent): harden reply thumbnail lifecycle
christian-byrne Sep 1, 2026
8edc86d
test(agent): assert visible thumbnail generation exactly
christian-byrne Sep 1, 2026
30c14ef
test(agent): cover visible-only reply asset previews
Glary-Bot Sep 1, 2026
ef5e8b4
fix(load3d): stop disposal from raising a model load error
Glary-Bot Sep 1, 2026
4008f80
fix(agent): bound thumbnail retries and cancel queued generation
Glary-Bot Sep 1, 2026
019eba9
fix(load3d): let a load opt out of every failure toast
Glary-Bot Sep 1, 2026
b9e1a75
fix(agent): retry only recoverable thumbnail failures
Glary-Bot Sep 1, 2026
3f190f7
test(agent): harden the reply asset preview e2e
Glary-Bot Sep 1, 2026
395f008
fix(load3d): give silent loads the real failure
Glary-Bot Sep 1, 2026
26e6f22
fix(agent): re-queue a timed-out thumbnail directly
Glary-Bot Sep 1, 2026
243a992
fix(agent): stop retrying a thumbnail that ran out of time
Glary-Bot Sep 1, 2026
a323731
fix(agent): stop the viewer chunk eating the model's deadline
Glary-Bot Sep 1, 2026
a3e14fe
Harden reply asset loading and previews
christian-byrne Aug 30, 2026
66e1ca1
fix: preserve persisted model thumbnails
christian-byrne Aug 31, 2026
0f546c5
fix(load3d): cancel in-flight loads on disposal
christian-byrne Sep 1, 2026
cfc4144
fix(load3d): bound thumbnail generation lifecycle
christian-byrne Sep 1, 2026
fec26dd
test(load3d): verify persisted thumbnail bytes
christian-byrne Sep 1, 2026
911779b
fix(agent): harden reply thumbnail lifecycle
christian-byrne Sep 1, 2026
23dfcaa
test(agent): assert visible thumbnail generation exactly
christian-byrne Sep 1, 2026
4d9e94a
Merge #16493 (glary reply-asset e2e regression + fixes) into #16430
ampagent Sep 2, 2026
4212d3d
Merge origin/main (catch up 41 commits incl. #16485) into christian-b…
ampagent Sep 2, 2026
cb619bd
test(load3d): fix post-merge fake-timer test bugs in modelThumbnail
ampagent Sep 2, 2026
f2c9822
fix(load3d): stop stale loads writing to shared manager state
Glary-Bot Sep 2, 2026
857cd47
fix(agent): model the thumbnail lifecycle as one state per url
Glary-Bot Sep 2, 2026
2fbe68b
fix(agent): close the retry and cancellation gaps properly
Glary-Bot Sep 2, 2026
fe6457d
fix(agent): redact the asset name and keep the error stack
Glary-Bot Sep 2, 2026
d548ebf
Merge remote-tracking branch 'origin/main' into w3pub-reply-assets
christian-byrne Sep 2, 2026
ffd046c
fix(load3d): stop disposal from raising a model load error
christian-byrne Sep 2, 2026
fc478c8
fix(load3d): let loadModel return a discriminated outcome
christian-byrne Sep 2, 2026
55c4285
fix(load3d): redact untrusted thumbnail URLs and classify cancellatio…
christian-byrne Sep 2, 2026
8088c95
fix(agent): bound thumbnail retries and cancel queued generation per …
christian-byrne Sep 2, 2026
dd0e15d
[automated] Apply ESLint and Oxfmt fixes
actions-user Sep 2, 2026
96b8052
fix(agent): address fresh CodeRabbit findings on reply-asset thumbnails
christian-byrne Sep 2, 2026
8a94f57
fix(agent): suppress console.error URL leak on silent missing-filenam…
christian-byrne Sep 2, 2026
145b1ec
fix(agent): cancel pending thumbnail retry timer when asset is hidden
ampagent Sep 2, 2026
7391b61
fix(load3d): merge w3pub-reply-assets and keep only the viewer outcom…
christian-byrne Sep 3, 2026
da89eac
test(load3d): cover redaction and viewer outcome branches
christian-byrne Sep 3, 2026
89db3b3
test(load3d): make the viewer fixture complete so initialization runs
Glary-Bot Sep 3, 2026
1f5c334
fix(load3d): restore viewer config on a failed standalone load
Glary-Bot Sep 3, 2026
29a0322
fix(load3d): keep the standalone config cache key and value in sync
Glary-Bot Sep 3, 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
2 changes: 1 addition & 1 deletion browser_tests/fixtures/utils/viewFileMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type RouteFulfillOptions = NonNullable<Parameters<Route['fulfill']>[0]>

type ViewFile = Pick<RouteFulfillOptions, 'body' | 'contentType' | 'path'>

const transparentPng = Buffer.from(
export const transparentPng = Buffer.from(
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgwJ/lwPIRwAAAABJRU5ErkJggg==',
'base64'
)
Expand Down
17 changes: 11 additions & 6 deletions browser_tests/tests/agent/agentPanelMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,20 @@ export const RESIZE_IMAGE_TOOL_EVENT: AgentWsEvent = {
const MESSAGE_DELTA_TEXT =
'The graph is **fully ready** to go β€” prompt set to the red fox in the snow.'

export const MESSAGE_DELTA_EVENT: AgentWsEvent = {
type: 'agent_message_delta',
data: {
delta: MESSAGE_DELTA_TEXT,
message_id: TURN_ID,
thread_id: THREAD_ID
export function messageDeltaEvent(delta: string): AgentWsEvent {
return {
type: 'agent_message_delta',
data: {
delta,
message_id: TURN_ID,
thread_id: THREAD_ID
}
}
}

export const MESSAGE_DELTA_EVENT: AgentWsEvent =
messageDeltaEvent(MESSAGE_DELTA_TEXT)

export const MESSAGE_DONE_EVENT: AgentWsEvent = {
type: 'agent_message_done',
data: {
Expand Down
127 changes: 127 additions & 0 deletions browser_tests/tests/agent/agentReplyAssets.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import type { Route, WebSocketRoute } from '@playwright/test'
import { expect, mergeTests } from '@playwright/test'

import { webSocketFixture } from '@e2e/fixtures/ws'

import enMessages from '@/locales/en/main.json' with { type: 'json' }
import type { FeatureFlagsWsMessage } from '@/schemas/apiSchema'
import type { AgentWsEvent } from '@/workbench/extensions/agent/schemas/agentApiSchema'

import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute'
import { transparentPng } from '@e2e/fixtures/utils/viewFileMocks'
import {
MESSAGE_DONE_EVENT,
agentTest,
messageDeltaEvent
} from '@e2e/tests/agent/agentPanelMocks'

const COLLAPSED_COUNT = 12
const MODEL_COUNT = 13
const HIDDEN_MODEL = `mesh-${MODEL_COUNT - 1}.glb`
const VISIBLE_MODELS = Array.from(
{ length: COLLAPSED_COUNT },
(_, index) => `mesh-${index}.glb`
)

const MODEL_REPLY = Array.from(
{ length: MODEL_COUNT },
(_, index) => `- ![mesh-${index}](/api/view?filename=mesh-${index}.glb)`
).join('\n')

type WsFrame =
| AgentWsEvent
| { type: 'feature_flags'; data: FeatureFlagsWsMessage }

function pushEvent(ws: WebSocketRoute, event: WsFrame): void {
ws.send(JSON.stringify(event))
}

/**
* Names the component asked the asset API about, in request order. Every
* looked-up model answers with a ready preview, so a tile renders without
* needing a WebGL thumbnail render.
*/
const test = mergeTests(agentTest, webSocketFixture).extend<{
lookedUpModels: string[]
}>({
lookedUpModels: async ({ page }, use) => {
const lookedUp: string[] = []

await page.route('**/api/assets**', (route: Route) => {
const url = new URL(route.request().url())
if (url.pathname.endsWith('/content'))
return route.fulfill({
contentType: 'image/png',
body: transparentPng
})

const name =
url.searchParams.get('hash') ?? url.searchParams.get('name_contains')
if (!name) return route.fulfill(jsonRoute({ assets: [] }))

if (/^mesh-\d+\.glb$/.test(name)) lookedUp.push(name)
return route.fulfill(
jsonRoute({
assets: [
{
id: `asset-${name}`,
name,
hash: name,
preview_id: `preview-${name}`
}
]
})
)
})

await use(lookedUp)
}
})

test.describe('Agent reply assets', { tag: '@cloud' }, () => {
test.use({ connectWebSocketToServer: false })

test('looks up 3D previews only for the reply assets on screen', async ({
comfyPage,
postedMessages,
getWebSocket,
lookedUpModels
}) => {
test.setTimeout(30_000)

const page = comfyPage.page
await page
.getByRole('button', { name: enMessages.agent.askComfyAgent })
.click()

const panel = page.locator('#agent-panel-root')
await panel
.getByRole('textbox', { name: /^Describe ideas/ })
.fill('show me every mesh')

const ws = await getWebSocket()
await panel.getByRole('button', { name: enMessages.agent.send }).click()
await expect.poll(() => postedMessages.length).toBeGreaterThanOrEqual(1)

pushEvent(ws, { type: 'feature_flags', data: { assets: true } })
pushEvent(ws, messageDeltaEvent(MODEL_REPLY))
pushEvent(ws, MESSAGE_DONE_EVENT)

const tiles = panel.getByRole('button', { name: /^mesh-\d+$/ })
const thumbnails = panel.locator('img[alt^="mesh-"]')

await expect(tiles).toHaveCount(COLLAPSED_COUNT)
await expect(thumbnails).toHaveCount(COLLAPSED_COUNT)
expect(
[...new Set(lookedUpModels)].sort(),
'a collapsed reply must look up the models it shows, and only those'
).toEqual([...VISIBLE_MODELS].sort())

await panel.getByRole('button', { name: enMessages.agent.showMore }).click()

await expect(tiles).toHaveCount(MODEL_COUNT)
await expect(thumbnails).toHaveCount(MODEL_COUNT)
await expect.poll(() => new Set(lookedUpModels).size).toBe(MODEL_COUNT)
expect(lookedUpModels).toContain(HIDDEN_MODEL)
})
})
Loading
Loading