Skip to content

Fix ambiguous file uploads - #231

Merged
esokullu merged 2 commits into
mainfrom
codex/fix-ambiguous-file-uploads
Aug 4, 2026
Merged

Fix ambiguous file uploads#231
esokullu merged 2 commits into
mainfrom
codex/fix-ambiguous-file-uploads

Conversation

@webbrain-one

Copy link
Copy Markdown
Collaborator

Summary

  • expose unique, verified file-input selectors with accept and multiple metadata
  • block ambiguous upload retries until a fresh interactive-element inspection
  • distinguish local attachment or page consumption from verified remote submission
  • add Hugging Face upload and commit guidance for Chrome and Firefox

Root cause

Pages such as Hugging Face expose multiple file inputs. Generic selectors could match more than one input, and successful local attachment results were easy to interpret as completed remote uploads before the explicit commit step.

Impact

Agents now recover deterministically from ambiguity, target repository file inputs correctly, and require observation plus an explicit commit before reporting remote success. Firefox retains its existing local-file limitations.

Validation

  • node --check passed for every changed agent, content, and test file
  • npm run test:security: 60/60 passed
  • npm test: 1441 passed; one unrelated existing changelog-version assertion failed (26.0.0 vs package 26.0.10)
  • npm run test:fixtures: 127 passed; all new upload fixtures passed, while two unrelated existing selection-shortcut fixtures failed in Chrome and Firefox

@esokullu

esokullu commented Aug 4, 2026

Copy link
Copy Markdown
Owner

@codex pls review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25ff5a9c8a

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1681 to +1682
if (name !== 'get_interactive_elements' || !Array.isArray(response)) return false;
this._uploadSelectorRecoveryRequired.delete(tabId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep recovery gated when inspection omits file inputs

When the page hides its file inputs with hidden/display:none (or makes them zero-sized in Firefox), get_interactive_elements still returns an array but the collectors omit every file-input record. This unconditional delete therefore clears the ambiguity gate without supplying any exact selector, allowing the next guessed unique selector to attach the file to the wrong input鈥攖he outcome this recovery mechanism is meant to prevent. Keep the gate until the response contains a file-input record with a verified selector, or make the inspection include hidden file inputs; the mirrored Firefox helper has the same issue.

Useful? React with 馃憤聽/ 馃憥.

@esokullu

esokullu commented Aug 4, 2026

Copy link
Copy Markdown
Owner

@codex pls review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 47336ab662

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@esokullu
esokullu merged commit eb4fb68 into main Aug 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants