File Attachment Limit Error

When a user attempts to add more than 3 files, an error message appears stating “Upgrade to ChatGPT Plus to attach more files or try again…” even if the files have not been sent in the chat. The current behavior mistakenly counts files that are only attached (but not yet sent) towards the attachment limit.

Steps to Reproduce:

  1. Open the file attachment interface.
  2. Attach more than 3 files without sending them in the chat.
  3. Observe the error message prompting an upgrade despite the files not being sent.
  4. Remove files from chat
  5. Try again attach file

Expected Behavior:
The system should restrict the total number of file attachments based on the files that have actually been sent in the chat. Files that are merely attached (but not sent) should not count towards the limit, thereby allowing the user to add the maximum number of files for eventual sending.

Actual Behavior:
The error message appears as soon as more than 3 files are attached, even if those files remain unsent in the chat, unnecessarily reducing the number of available file attachments.

Impact:
This bug may confuse users and prevent them from attaching files properly, hindering their workflow and overall user experience.

Proposed Fix:
Adjust the file attachment logic so that the available file count only decreases when a file is actually sent in the chat. Unsents attachments should not reduce the user’s ability to attach additional files up to the defined limit.