-
Notifications
You must be signed in to change notification settings - Fork 166
Description
Summary
In browser mode with ChatGPT attachments, local runs can get into a split-brain state between attachment completion and send readiness:
waitForAttachmentCompletionwaits on one readiness contractattemptSendButtonlater uses a different one- when attachment confirmation times out, local browser mode clears
attachmentNamesand continues anyway - submit can then fall back to
Enter, leaving the prompt unsent and eventually failing withPrompt did not appear in conversation before timeout (send may have failed)
This appears distinct from #10: in this repro the prompt never commits, and the log shows Submitted prompt via Enter key, not Clicked send button.
Environment
- oracle HEAD:
ab116c0 - browser mode with manual-login profile
- model:
gpt-5.4-pro --browser-attachments always- reproducible with two small text files
Reproduction
Example command:
pnpm run oracle -- --engine browser \
--browser-manual-login \
--browser-port 9333 \
--browser-reuse-wait 10s \
--browser-profile-lock-timeout 300s \
--model gpt-5.4-pro \
--browser-attachments always \
--prompt "Attachment send race reproduction. Reply exactly with OK." \
--file /tmp/a.txt \
--file /tmp/b.txt \
--verbose- Reuse a signed-in ChatGPT browser profile.
- Force attachment upload mode with two small files.
- Observe verbose logs during the attachment wait and send phases.
Failure log excerpt
This is the failing sequence from the real repro log:
Uploading attachment: ../../../tmp/oracle-race.aKIUsa/a.txt
Attachment queued (UI anchored, file input confirmed)
Uploading attachment: ../../../tmp/oracle-race.aKIUsa/b.txt
Attachment queued (UI anchored, file input confirmed)
Attachment wait state: {"state":"disabled","uploading":false,"filesAttached":true,"attachedNames":["remove file","remove file","remove file"],"inputNames":["b.txt"],"fileCount":0}
...
Attachment upload timed out while waiting for ChatGPT composer to become ready.
[browser] Attachment upload timed out after 80s; continuing without confirmation.
Submitted prompt via Enter key
Prompt commit check failed; latest state: {"baseline":0,"userMatched":false,"prefixMatched":false,"lastMatched":false,"hasNewTurn":false,...}
Failed to complete ChatGPT run: Prompt did not appear in conversation before timeout (send may have failed)
Actual behavior
The run waits in a disabled-button state until attachment confirmation times out, then local browser mode continues without confirmation and later falls back to Enter.
Expected behavior
For attachment submissions Oracle should either:
- wait until the same composer is actually send-ready and click send, or
- fail fast with an explicit attachment/browser automation error
It should not degrade into a plain-text Enter submit after attachment confirmation fails.
Root cause
The attachment lifecycle and send lifecycle currently use different readiness contracts:
waitForAttachmentCompletioninsrc/browser/actions/attachments.tsattemptSendButtoninsrc/browser/actions/promptComposer.ts- local browser mode in
src/browser/index.tscatches attachment timeout, dropsattachmentNames, and keeps going
That violates the invariant that an attachment submission must not enter the send path unless the same composer has stable attachment evidence and a clickable send button.
Fix candidate validation
The candidate fix in PR #116 was validated with a live browser run. The repaired flow now waits for stable attachment evidence, then waits for the same composer to become send-ready before clicking send:
Uploading attachment: ../../../tmp/oracle-attach-min.1yYKNT/oracle-live-1773660483-12767-verify-note.txt
Attachment queued (UI anchored, file input confirmed)
Attachment wait state: {"state":"disabled","uploading":false,"filesAttached":true,"fileCount":0,"attachmentUiCount":1,"attachedNames":["remove file"],"inputNames":["oracle-live-1773660483-12767-verify-note.txt"],"attachedMatch":false,"inputMatch":true,"fileCountSatisfied":false,"attachmentUiSatisfied":true}
All attachments uploaded
Attachment send readiness: {"state":"disabled","uploading":false,"filesAttached":true,...}
Clicked send button
Verified attachments present on sent user message
Answer:
OK