Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Fix file uploads in X's compose dialog
Claude93963cfc3b9e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e05cdb7f0..eb42be042 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,6 +9,9 @@ This changelog was generated from the repository Git history and release tags. V### Changed- The spinning ring next to "Thinking…" in the side panel is now a small WebBrain brain drawn as a neural circuit: a signal keeps tracing the W, and the brain's outline lights up as it passes. It moves only while WebBrain is working and the panel is visible, follows the light and dark themes, and holds still when your system asks to reduce motion.+### Fixed+- Act can attach images and videos to a post on X again. While the post composer is open at x.com/compose/post, the timeline behind it keeps a second, identical file input, and WebBrain's list of the page's controls gave neither input a selector. After the model's first selector matched both, WebBrain refused every later upload until it saw a selector it could not get, so the run ended at its cost limit with nothing attached. The list now gives every file input a selector that matches only that input, scoped to the open dialog where that is what tells them apart, and marks the dialog's input `inDialog`. The X site notes name the dialog's input, and when no selector can single out an input, WebBrain tells the model to report the upload as blocked instead of retrying.+## [42.3.1] - 2026-10-20### Changeddiff --git a/src/chrome/src/agent/adapters.js b/src/chrome/src/agent/adapters.jsindex 5f4380fe5..96344e868 100644--- a/src/chrome/src/agent/adapters.js+++ b/src/chrome/src/agent/adapters.js@@ -16290,6 +16290,7 @@ const ADAPTERS = [- On /i/chat/<conversation>, the DM composer stays visible after sending. Verify the exact new outgoing message and its sent status in the same conversation; do not resend because the composer remains open.- The public post composer is a contenteditable, not a textarea. Character count is enforced client-side at 280 (or higher for Premium).- On /compose/post, call wait_for_stable before filling the composer. After typing, re-read the visible accessibility tree and require the Post control to be enabled (no disabled=true) before clicking it.+- Media attaches through the hidden input[data-testid="fileInput"] beside "Add photos or video": pass it to upload_file and never click that button, which opens an OS file dialog. While a composer dialog is open (/compose/post or a reply dialog), the timeline behind it keeps an identical input, so use the selector [role="dialog"] input[data-testid="fileInput"] (as of 2026-10).- If the exact text is visible but Post remains disabled, keep the composer open and refill the editor with type_text({selector:"[data-testid=\\\"tweetTextarea_0\\\"]", text:"<exact complete post>", clear:true}); this uses the trusted Chrome typing path. Do not dismiss the composer to recover.- A click_ax result with verified:false or no observable posting evidence is not proof that the post was published. Keep the composer open and verify a new status URL or matching feed item before reporting success.- The timeline is virtualized — tweets scroll out of the DOM. To find a specific tweet, use search, don't scroll.diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.jsindex bc2ab4a79..7679b57f2 100644--- a/src/chrome/src/agent/agent.js+++ b/src/chrome/src/agent/agent.js@@ -10330,6 +10330,9 @@ export class Agent extends LoopDetector {...(element.accept != null ? { accept: String(element.accept).slice(0, 200) } : {}),multiple: element.multiple === true,inShadowDOM: element.inShadowDOM === true,+ // X's dialog composer and the timeline composer behind it carry the+ // same unlabelled input: this says which one the open dialog owns.+ ...(element.inDialog === true ? { inDialog: true } : {}),};});@@ -49856,7 +49859,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout dambiguous: true,matchCount: Number(this._uploadSelectorRecoveryRequired.get(tabId)) || 0,recoveryRequired: 'get_interactive_elements',- error: 'A previous upload selector matched multiple file inputs. Call get_interactive_elements now and use the exact selector returned on the intended file-input record before retrying upload_file; do not guess another selector variant.',+ error: 'A previous upload selector matched multiple file inputs. Call get_interactive_elements now and use the exact selector returned on the intended file-input record before retrying upload_file; do not guess another selector variant. A record marked inDialog belongs to an open dialog, such as a composer you opened. If no file-input record has a selector, no selector can single out the input: report the upload as blocked instead of retrying.',};}if (!attachmentPayload && args.attachmentId != null) {@@ -49956,7 +49959,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout dambiguous: true,matchCount: objectIds.length,recoveryRequired: 'get_interactive_elements',- error: `Selector "${args.selector}" matched ${objectIds.length} elements across the document and open shadow roots. Call get_interactive_elements and use the exact, unique selector returned on the intended file-input record; do not guess another selector variant.`,+ error: `Selector "${args.selector}" matched ${objectIds.length} elements across the document and open shadow roots. Call get_interactive_elements and use the exact, unique selector returned on the intended file-input record; do not guess another selector variant. A record marked inDialog belongs to an open dialog, such as a composer you opened. If no file-input record has a selector, no selector can single out the input: report the upload as blocked instead of retrying.`,};}diff --git a/src/chrome/src/agent/page-feedback.js b/src/chrome/src/agent/page-feedback.jsindex 0acf3dbbf..7d3c1740f 100644--- a/src/chrome/src/agent/page-feedback.js+++ b/src/chrome/src/agent/page-feedback.js@@ -241,7 +241,7 @@ function actionBindingUnavailableResult(run, name) {errorCode: 'action_binding_unavailable',...(['target_ambiguous', 'target_unresolved', 'target_uncovered'].includes(reason) ? { bindingFailure: reason } : {}),recoveryRequired: 'get_interactive_elements',- error: explanation + ' Nothing was attached. Call get_interactive_elements again, identify the intended file-input record by its upload widget context, and copy its exact selector into a new upload_file call with the same attachmentId, downloadId, or filePath. Do not guess a selector or click the upload control.' };+ error: explanation + ' Nothing was attached. Call get_interactive_elements again, identify the intended file-input record by its upload widget context (inDialog marks one inside an open dialog, such as a composer you opened), and copy its exact selector into a new upload_file call with the same attachmentId, downloadId, or filePath. Do not guess a selector or click the upload control. If no file-input record has a selector, no selector can single out the input: report the upload as blocked instead of retrying.' };}return { success: false, skipped: true, dispatched: false, noDispatch: true, retryable: false,errorCode: 'action_binding_unavailable',diff --git a/src/chrome/src/content/content.js b/src/chrome/src/content/content.jsindex 75903ebc5..93a677e6c 100644--- a/src/chrome/src/content/content.js+++ b/src/chrome/src/content/content.js@@ -4254,6 +4254,18 @@return parts.join(' > ');}+ // The open dialogs that contain a file input. X opens its post composer at+ // /compose/post as a dialog over the home timeline, and the timeline's+ // inline composer keeps an identical hidden input (same accept and+ // multiple, no id or name, same ten nearest ancestors): only the dialog+ // tells the two apart.+ function _fileInputDialogScopes(el) {+ return ['[role="dialog"]', '[role="alertdialog"]', '[aria-modal="true"]', 'dialog[open]']+ .filter(scope => {+ try { return !!el.closest(scope); } catch { return false; }+ });+ }+function _uniqueFileInputSelector(el) {if (!(el instanceof HTMLInputElement) || el.type !== 'file') return '';const candidates = [];@@ -4270,11 +4282,20 @@candidates.push(`input[type="file"]${acceptPart}`);const path = _fileInputPath(el);if (path) candidates.push(path);+ for (const scope of _fileInputDialogScopes(el)) {+ candidates.push(`${scope} input[type="file"]${acceptPart}${multiplePart}`);+ candidates.push(`${scope} input[type="file"]${acceptPart}`);+ }for (const selector of candidates) {const matches = _deepSelectorMatches(selector);if (matches.length === 1 && matches[0] === el) return selector;}- return '';+ // A record without a selector leaves the model nothing it may use, and a+ // failed upload's recovery waits for one (trace e6187b5f: 15 refused+ // upload_file calls on X). Climb until the path is unique. Only identical+ // inputs in separate shadow roots stay without one: no selector reaches+ // across a shadow boundary, so none could single one out.+ return uniqueFileInputSelector(el) || '';}// Internal Compact-upload discovery. This is intentionally not a model@@ -4298,6 +4319,7 @@accept: el.getAttribute('accept'),multiple: el.hasAttribute('multiple'),inShadowDOM,+ ...(_fileInputDialogScopes(el).length ? { inDialog: true } : {}),...(selector ? { selector } : {}),});});@@ -4329,6 +4351,9 @@const selector = _uniqueFileInputSelector(el);result.accept = el.getAttribute('accept');result.multiple = el.hasAttribute('multiple');+ // Says which of two otherwise identical inputs belongs to the open+ // dialog, such as the composer the model just opened.+ if (_fileInputDialogScopes(el).length) result.inDialog = true;if (selector) result.selector = selector;}return result;diff --git a/src/firefox/src/agent/adapters.js b/src/firefox/src/agent/adapters.jsindex 8d2c2945c..25ef0e542 100644--- a/src/firefox/src/agent/adapters.js+++ b/src/firefox/src/agent/adapters.js@@ -16289,6 +16289,7 @@ const ADAPTERS = [- On /i/chat/<conversation>, the DM composer stays visible after sending. Verify the exact new outgoing message and its sent status in the same conversation; do not resend because the composer remains open.- The public post composer is a contenteditable, not a textarea. Character count is enforced client-side at 280 (or higher for Premium).- On /compose/post, call wait_for_stable before filling the composer. After typing, re-read the visible accessibility tree and require the Post control to be enabled (no disabled=true) before clicking it.+- Media attaches through the hidden input[data-testid="fileInput"] beside "Add photos or video": pass it to upload_file and never click that button, which opens an OS file dialog. While a composer dialog is open (/compose/post or a reply dialog), the timeline behind it keeps an identical input, so use the selector [role="dialog"] input[data-testid="fileInput"] (as of 2026-10).- If the exact text is visible but Post remains disabled, keep the composer open and refill the editor with type_text({selector:"[data-testid=\\\"tweetTextarea_0\\\"]", text:"<exact complete post>", clear:true}). Do not dismiss the composer to recover.- A click_ax result with verified:false or no observable posting evidence is not proof that the post was published. Keep the composer open and verify a new status URL or matching feed item before reporting success.- The timeline is virtualized — tweets scroll out of the DOM. To find a specific tweet, use search, don't scroll.diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.jsindex 45af823c6..2cfe73c37 100644--- a/src/firefox/src/agent/agent.js+++ b/src/firefox/src/agent/agent.js@@ -10035,6 +10035,9 @@ export class Agent extends LoopDetector {...(element.accept != null ? { accept: String(element.accept).slice(0, 200) } : {}),multiple: element.multiple === true,inShadowDOM: element.inShadowDOM === true,+ // X's dialog composer and the timeline composer behind it carry the+ // same unlabelled input: this says which one the open dialog owns.+ ...(element.inDialog === true ? { inDialog: true } : {}),};});@@ -43370,7 +43373,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout dambiguous: true,matchCount: Number(this._uploadSelectorRecoveryRequired.get(tabId)) || 0,recoveryRequired: 'get_interactive_elements',- error: 'A previous upload selector matched multiple file inputs. Call get_interactive_elements now and use the exact selector returned on the intended file-input record before retrying upload_file; do not guess another selector variant.',+ error: 'A previous upload selector matched multiple file inputs. Call get_interactive_elements now and use the exact selector returned on the intended file-input record before retrying upload_file; do not guess another selector variant. A record marked inDialog belongs to an open dialog, such as a composer you opened. If no file-input record has a selector, no selector can single out the input: report the upload as blocked instead of retrying.',};}if (args.filePath) {@@ -43758,7 +43761,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout drecoveryRequired: 'get_interactive_elements',} : {}),error: targetProbe?.ambiguous- ? `${targetProbe.error} Call get_interactive_elements and use the exact, unique selector returned on the intended file-input record; do not guess another selector variant.`+ ? `${targetProbe.error} Call get_interactive_elements and use the exact, unique selector returned on the intended file-input record; do not guess another selector variant. A record marked inDialog belongs to an open dialog, such as a composer you opened. If no file-input record has a selector, no selector can single out the input: report the upload as blocked instead of retrying.`: (targetProbe ? targetProbe.error : 'Failed to inspect the file input before attachment'),};}@@ -43860,7 +43863,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout drecoveryRequired: 'get_interactive_elements',} : {}),error: res.ambiguous- ? `${res.error} Call get_interactive_elements and use the exact, unique selector returned on the intended file-input record; do not guess another selector variant.`+ ? `${res.error} Call get_interactive_elements and use the exact, unique selector returned on the intended file-input record; do not guess another selector variant. A record marked inDialog belongs to an open dialog, such as a composer you opened. If no file-input record has a selector, no selector can single out the input: report the upload as blocked instead of retrying.`: res.error,};}diff --git a/src/firefox/src/agent/page-feedback.js b/src/firefox/src/agent/page-feedback.jsindex 0acf3dbbf..7d3c1740f 100644--- a/src/firefox/src/agent/page-feedback.js+++ b/src/firefox/src/agent/page-feedback.js@@ -241,7 +241,7 @@ function actionBindingUnavailableResult(run, name) {errorCode: 'action_binding_unavailable',...(['target_ambiguous', 'target_unresolved', 'target_uncovered'].includes(reason) ? { bindingFailure: reason } : {}),recoveryRequired: 'get_interactive_elements',- error: explanation + ' Nothing was attached. Call get_interactive_elements again, identify the intended file-input record by its upload widget context, and copy its exact selector into a new upload_file call with the same attachmentId, downloadId, or filePath. Do not guess a selector or click the upload control.' };+ error: explanation + ' Nothing was attached. Call get_interactive_elements again, identify the intended file-input record by its upload widget context (inDialog marks one inside an open dialog, such as a composer you opened), and copy its exact selector into a new upload_file call with the same attachmentId, downloadId, or filePath. Do not guess a selector or click the upload control. If no file-input record has a selector, no selector can single out the input: report the upload as blocked instead of retrying.' };}return { success: false, skipped: true, dispatched: false, noDispatch: true, retryable: false,errorCode: 'action_binding_unavailable',diff --git a/src/firefox/src/content/content.js b/src/firefox/src/content/content.jsindex 2653bbf92..caabbda46 100644--- a/src/firefox/src/content/content.js+++ b/src/firefox/src/content/content.js@@ -1359,6 +1359,18 @@return parts.join(' > ');}+ // The open dialogs that contain a file input. X opens its post composer at+ // /compose/post as a dialog over the home timeline, and the timeline's+ // inline composer keeps an identical hidden input (same accept and+ // multiple, no id or name, same ten nearest ancestors): only the dialog+ // tells the two apart.+ function _fileInputDialogScopes(el) {+ return ['[role="dialog"]', '[role="alertdialog"]', '[aria-modal="true"]', 'dialog[open]']+ .filter(scope => {+ try { return !!el.closest(scope); } catch { return false; }+ });+ }+function _uniqueFileInputSelector(el) {if (!(el instanceof HTMLInputElement) || el.type !== 'file') return '';const candidates = [];@@ -1375,11 +1387,20 @@candidates.push(`input[type="file"]${acceptPart}`);const path = _fileInputPath(el);if (path) candidates.push(path);+ for (const scope of _fileInputDialogScopes(el)) {+ candidates.push(`${scope} input[type="file"]${acceptPart}${multiplePart}`);+ candidates.push(`${scope} input[type="file"]${acceptPart}`);+ }for (const selector of candidates) {const matches = _deepSelectorMatches(selector);if (matches.length === 1 && matches[0] === el) return selector;}- return '';+ // A record without a selector leaves the model nothing it may use, and a+ // failed upload's recovery waits for one (trace e6187b5f: 15 refused+ // upload_file calls on X). Climb until the path is unique. Only identical+ // inputs in separate shadow roots stay without one: no selector reaches+ // across a shadow boundary, so none could single one out.+ return uniqueFileInputSelector(el) || '';}// Internal Compact-upload discovery. This is intentionally not a model@@ -1403,6 +1424,7 @@accept: el.getAttribute('accept'),multiple: el.hasAttribute('multiple'),inShadowDOM,+ ...(_fileInputDialogScopes(el).length ? { inDialog: true } : {}),...(selector ? { selector } : {}),});});@@ -1521,6 +1543,9 @@const selector = _uniqueFileInputSelector(el);result.accept = el.getAttribute('accept');result.multiple = el.hasAttribute('multiple');+ // Says which of two otherwise identical inputs belongs to the open+ // dialog, such as the composer the model just opened.+ if (_fileInputDialogScopes(el).length) result.inDialog = true;if (selector) result.selector = selector;}return result;diff --git a/test/fixtures/run.mjs b/test/fixtures/run.mjsindex 7d66cc630..aaf759600 100644--- a/test/fixtures/run.mjs+++ b/test/fixtures/run.mjs@@ -35,6 +35,7 @@ import {import { registerRichTextToolbarFixtures } from './rich-text-toolbar.mjs';import { registerMessageRecipientNavigationFixtures } from './message-recipient-navigation.mjs';import { registerInteractionReviewRegressions } from './interaction-review-regressions.mjs';+import { xComposeUploadHtml } from '../lib/upload-release-fixture.mjs';const __dirname = path.dirname(fileURLToPath(import.meta.url));@@ -4423,6 +4424,59 @@ for (const browserKind of ['chrome', 'firefox']) {}});+ // Trace e6187b5f (WebBrain 42.3.1, x.com/compose/post): neither of X's two+ // identical file-input records carried a selector, so the upload recovery+ // never released and all 15 upload_file calls were refused until the run's+ // cost limit.+ test(`get_interactive_elements (${browserKind}): tells X's dialog composer file input from the timeline copy behind it`, async (page) => {+ const setupHtml = browserKind === 'firefox' ? setupFirefoxHtml : setupChromeHtml;+ await setupHtml(page, xComposeUploadHtml);++ // The selectors the run tried first match both inputs.+ const bareMatches = await page.evaluate(() => document.querySelectorAll('input[data-testid="fileInput"]').length);+ if (bareMatches !== 2) throw new Error(`fixture must reproduce X's duplicate file input, got ${bareMatches}`);++ const resolve = (selector) => page.evaluate((selector) => {+ const matches = document.querySelectorAll(selector);+ return {+ count: matches.length,+ inDialog: !!matches[0]?.closest('[role="dialog"]'),+ inTimeline: !!matches[0]?.closest('main'),+ };+ }, selector);+ for (const action of ['get_interactive_elements_cdp', 'get_file_input_targets']) {+ const records = (await call(page, action, {})).filter((element) => element.type === 'file');+ if (records.length !== 2) throw new Error(`${action}: expected both X file inputs, got ${JSON.stringify(records)}`);+ if (!records.every((record) => typeof record.selector === 'string' && record.selector)) {+ throw new Error(`${action}: every X file input needs a selector the model may use: ${JSON.stringify(records)}`);+ }+ const dialogInput = records.find((record) => record.inDialog === true);+ const timelineInput = records.find((record) => record !== dialogInput);+ if (!dialogInput || Object.hasOwn(timelineInput, 'inDialog')) {+ throw new Error(`${action}: only the dialog composer's input may be marked inDialog: ${JSON.stringify(records)}`);+ }+ if (!dialogInput.selector.startsWith('[role="dialog"] ')) {+ throw new Error(`${action}: the dialog composer's selector should name its dialog: ${JSON.stringify(dialogInput)}`);+ }+ const dialogTarget = await resolve(dialogInput.selector);+ const timelineTarget = await resolve(timelineInput.selector);+ if (dialogTarget.count !== 1 || !dialogTarget.inDialog+ || timelineTarget.count !== 1 || !timelineTarget.inTimeline) {+ throw new Error(`${action}: selectors must each match only their own input: ${JSON.stringify({ records, dialogTarget, timelineTarget })}`);+ }+ }++ // This inventory is what releases the recovery an ambiguous upload+ // selector sets; in the trace no inspection could.+ const inventory = await call(page, 'get_interactive_elements_cdp', {});+ const recovery = { _uploadSelectorRecoveryRequired: new Map([[77, 2]]) };+ const AgentClass = browserKind === 'firefox' ? FirefoxAgent : Agent;+ if (!AgentClass.prototype._clearUploadSelectorRecoveryAfterInspection.call(recovery, 77, 'get_interactive_elements', inventory)+ || recovery._uploadSelectorRecoveryRequired.has(77)) {+ throw new Error('the X inventory did not release upload recovery');+ }+ });+test(`file picker guard (${browserKind}): blocks the native chooser and returns the exact input`, async (page) => {await setupContentHtml(page, `<!doctype html><button id="choose">Select a file...</button>diff --git a/test/lib/upload-release-fixture.mjs b/test/lib/upload-release-fixture.mjsindex 062978324..b25460226 100644--- a/test/lib/upload-release-fixture.mjs+++ b/test/lib/upload-release-fixture.mjs@@ -18,6 +18,34 @@ for(const [slot,id] of [['markdown','fc-release-body'],['binary','releases-uploa});document.getElementById('binary-button').onclick=()=>{chooserClicks++;document.getElementById('releases-upload').click();};document.getElementById('release-form').onsubmit=event=>event.preventDefault();</script>`;+// Trace e6187b5f (WebBrain 42.3.1, x.com/compose/post): X opens the post+// composer as a dialog over the home timeline, and the timeline's inline+// composer keeps its own hidden input[data-testid="fileInput"]. The two share+// accept, multiple and their ten nearest ancestors; only the dialog differs.+// The toolbar skeleton is X's own as of 2026-10 (text and icons omitted).+const xComposerToolbar = `<nav role="navigation"><div>+<div data-testid="ScrollSnap-prevButtonWrapper" style="opacity:0"><button type="button" aria-label="Previous" disabled tabindex="-1"><span><</span></button></div>+<div data-testid="ScrollSnap-SwipeableList"><div role="tablist" data-testid="ScrollSnap-List">+<div role="presentation"><div><div><div>+<button type="button" role="button" aria-label="Add photos or video"><span>Media</span></button>+<input type="file" data-testid="fileInput" tabindex="-1" multiple accept="image/jpeg,image/png,image/webp,image/gif,video/mp4,video/quicktime">+</div></div></div></div>+<div role="presentation"><div><div><button type="button" role="button" data-testid="gifSearchButton" aria-label="Add a GIF"><span>GIF</span></button></div></div></div>+<div role="presentation"><div><div><button type="button" role="button" data-testid="createPollButton" aria-label="Add poll"><span>Poll</span></button></div></div></div>+<div role="presentation"><div><div><div><button type="button" role="button" aria-label="Add emoji"><span>Emoji</span></button></div></div></div></div>+</div></div>+<div data-testid="ScrollSnap-nextButtonWrapper" style="opacity:0"><button type="button" aria-label="Next" disabled tabindex="-1"><span>></span></button></div>+</div></nav>`;+const xComposer = postButton => `<div contenteditable="true" role="textbox" aria-label="Post text" aria-multiline="true" data-testid="tweetTextarea_0"><div><br></div></div>+<div data-testid="toolBar">${xComposerToolbar}<button type="button" data-testid="${postButton}" disabled>Post</button></div>`;+export const xComposeUploadHtml = `<!doctype html><meta charset="utf-8"><title>Compose post / X</title>+<style>body{margin:0;font:15px system-ui}input[type=file]{position:absolute;width:0;height:0;opacity:0}+#layers{position:fixed;inset:0;display:flex;justify-content:center;align-items:flex-start}+[aria-modal=true]{margin-top:40px;width:600px;background:#fff;padding:12px}</style>+<main aria-label="Home timeline"><div class="inline-composer">${xComposer('tweetButtonInline')}</div></main>+<div id="layers"><div role="dialog"><div role="dialog" aria-modal="true" aria-label="Compose post"><div role="group">+<button type="button" aria-label="Close">x</button>${xComposer('tweetButton')}</div></div></div></div>`;+// A page may replace its hidden transport wrapper with a directly clipped// native slot after consuming the first attachment. Asset editors live next// to the exclusive dropzone and remain part of the same release form.diff --git a/test/page-monitor-upload-release.mjs b/test/page-monitor-upload-release.mjsindex 9cb586c8c..2a70af83c 100644--- a/test/page-monitor-upload-release.mjs+++ b/test/page-monitor-upload-release.mjs@@ -2,7 +2,7 @@ import assert from 'node:assert/strict';import fs from 'node:fs/promises';import { test } from 'node:test';import { chromium, firefox } from 'playwright';-import { uploadReleaseHtml, stageSequentialReleaseUploads } from './lib/upload-release-fixture.mjs';+import { uploadReleaseHtml, stageSequentialReleaseUploads, xComposeUploadHtml } from './lib/upload-release-fixture.mjs';const recipientUploadHtml = `<!doctype html><style>#binary-widget{display:block;width:400px;padding:10px}input[type=file]{width:1px;height:1px;opacity:0}@@ -272,6 +272,19 @@ for (const [build, engine] of [['chrome', chromium], ['firefox', firefox]]) {await page.evaluate(() => document.getElementById('fc-release-body').id = 'releases-upload');assert.equal((await validate(page, snapshot)).ready, false);}));+ // Trace e6187b5f: X's test id names the composer dialog's input and the+ // timeline composer's copy behind it. The inventory must still name the+ // dialog's input exactly enough to bind.+ await t.test('X dialog composer input binds by its inventory selector, not the shared test id', () => withFixture(async page => {+ const snapshot = await capture(page);+ assert.equal((await validate(page, snapshot, 'input[data-testid="fileInput"]')).reason, 'target_ambiguous');+ const files = (await page.evaluate(() => deliver('get_interactive_elements_cdp'))).filter(item => item.type === 'file');+ const dialogInput = files.find(item => item.inDialog === true);+ assert.ok(dialogInput?.selector && files.every(item => item.selector), JSON.stringify(files));+ const fresh = await capture(page, { uploadTargets: files.map(item => item.selector) });+ const validation = await validate(page, fresh, dialogInput.selector);+ assert.equal(validation.ready, true, JSON.stringify(validation));+ }, xComposeUploadHtml));for (const authority of ['user', 'Stop', 'run', 'document']) await t.test(`${authority} revokes upload authority`, () => withFixture(async page => {const snapshot = await capture(page);const attached = await attach(page, snapshot, async page => {