Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
eb80a7e
fix(agent): bound attachment upload contract
christian-byrne Sep 4, 2026
3e5bb44
Merge remote-tracking branch 'comfyorg/main' into wt/pr16985-attach
christian-byrne Sep 11, 2026
90a5456
test(agent): pin the approved picker extensions literally
christian-byrne Sep 11, 2026
cce78d7
fix(agent): bound the attachment upload contract by size, not wall clock
christian-byrne Sep 11, 2026
9a1014e
fix(agent): cancel attachment uploads and refresh assets once per batch
christian-byrne Sep 11, 2026
7f0743c
fix(agent): cancel queued uploads and chain library refreshes
christian-byrne Sep 11, 2026
ca007f4
fix(agent): terminate the asset refresh chain on failure
christian-byrne Sep 11, 2026
2f3f8c0
test(agent): cover server attachment upload limit
christian-byrne Sep 16, 2026
74987c8
merge: integrate current main while preserving attachment cancellatio…
christian-byrne Sep 18, 2026
6bd05f5
fix(agent): remove cancelled attachments before persisting drafts
christian-byrne Sep 18, 2026
c2aadac
fix(agent): preserve Undo for removed in-flight attachments
christian-byrne Sep 18, 2026
64071fd
fix(agent): share upload slots across attachment sources
christian-byrne Sep 18, 2026
f3e00d3
fix(agent): let attachment deadlines control upload transport
christian-byrne Sep 18, 2026
24a5b09
fix(agent): silence deferred attachment warnings after cancellation
christian-byrne Sep 18, 2026
8034920
chore: merge main into attachment upload branch
christian-byrne Sep 20, 2026
9be8ce9
Merge remote-tracking branch 'comfyorg/main' into feprrev-16985
christian-byrne Sep 20, 2026
71f4a4a
test: disambiguate the Agent panel opener
christian-byrne Sep 20, 2026
c391a4d
fix: honor advertised attachment limit
christian-byrne Sep 21, 2026
a170b85
fix: remove dead attachment event chain
christian-byrne Sep 21, 2026
28a6c6e
fix: use generated upload response schema
christian-byrne Sep 21, 2026
bf1d953
chore: merge main into attachment upload branch
christian-byrne Sep 21, 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
63 changes: 63 additions & 0 deletions browser_tests/tests/agent/agentAttachmentUpload.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { expect } from '@playwright/test'

import enMessages from '@/locales/en/main.json' with { type: 'json' }

import { agentTest as test } from '@e2e/tests/agent/agentPanelMocks'

test.describe('Agent attachment cancellation', { tag: '@cloud' }, () => {
test('closing the panel removes a pending upload and preserves a sendable draft', async ({
comfyPage,
agentPanel
}) => {
const page = comfyPage.page
let releaseUpload = () => {}
const uploadHeld = new Promise<void>((resolve) => {
releaseUpload = resolve
})
await page.route('**/api/upload/image', async (route) => {
await uploadHeld
await route.abort()
})

try {
const openButton = page.getByRole('button', {
name: enMessages.agent.entryButton,
exact: true
})
await openButton.click()
await agentPanel.selectWorkflow()
const panel = page.locator('#agent-panel-root')
const composer = panel.getByRole('textbox', { name: /^Describe ideas/ })
const send = panel.getByRole('button', { name: 'Send', exact: true })
await composer.fill('Keep this draft')
await expect(send).toBeEnabled()

const uploadReceived = page.waitForRequest('**/api/upload/image')
await panel.getByTestId('agent-file-input').setInputFiles({
name: 'pending.mp4',
mimeType: 'video/mp4',
buffer: Buffer.from('pending upload')
})
await uploadReceived
await expect(
panel.getByTestId('composer-asset-section').getByText('pending.mp4')
).toBeVisible()
await expect(send).toBeDisabled()

await panel
.getByRole('button', { name: enMessages.g.close, exact: true })
.click()
await expect(panel).toHaveCount(0)
await openButton.click()

await expect(composer).toHaveText('Keep this draft')
await expect(panel.getByText('pending.mp4', { exact: true })).toHaveCount(
0
)
await expect(send).toBeEnabled()
} finally {
releaseUpload()
await page.unrouteAll({ behavior: 'wait' })
}
})
})
56 changes: 56 additions & 0 deletions browser_tests/tests/agent/agentPanel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,62 @@ test.describe('In-App Agent panel', { tag: '@cloud' }, () => {
.toBeLessThanOrEqual(1)
})

test('uses the server upload limit for Agent file attachments', async ({
comfyPage,
agentPanel
}) => {
test.setTimeout(60_000)
const page = comfyPage.page
let uploadCount = 0
await page.route('**/api/upload/image', async (route) => {
uploadCount += 1
await route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
name: 'uploaded_movie.mp4',
subfolder: '',
type: 'input'
})
})
})
await page.evaluate(() => {
window.app!.api.serverFeatureFlags.value = {
...window.app!.api.serverFeatureFlags.value,
max_upload_size: 24 * 1024 * 1024
}
})

await agentPanel.open()
const panel = page.locator('#agent-panel-root')
const fileInput = panel.getByTestId('agent-file-input')

const uploadResponse = page.waitForResponse('**/api/upload/image')
await fileInput.setInputFiles({
name: 'movie.mp4',
mimeType: 'video/mp4',
buffer: Buffer.alloc(21 * 1024 * 1024)
})
expect((await uploadResponse).ok()).toBe(true)
await expect(
panel.getByTestId('composer-asset-section').getByText('movie.mp4')
).toBeVisible()
await expect.poll(() => uploadCount).toBe(1)

await fileInput.setInputFiles({
name: 'too-large.mp4',
mimeType: 'video/mp4',
buffer: Buffer.alloc(25 * 1024 * 1024)
})
await expect(
page.getByText('too-large.mp4 is larger than 24 MB')
).toBeVisible()
await expect(panel.getByText('too-large.mp4', { exact: true })).toHaveCount(
0
)
await expect.poll(() => uploadCount).toBe(1)
})

test('exits node selection when the active workflow changes', async ({
agentPanel,
comfyPage
Expand Down
Loading
Loading