Skip to content

Conversation

@mikedemarais
Copy link
Contributor

When using Oracle in browser mode, prompts would be correctly injected into ChatGPT's textarea—you could see the text appear—but then nothing would happen. Oracle would hang indefinitely, waiting for a response that never came because the send button was never actually triggered.

The root cause: ChatGPT's React-based UI doesn't respond to simple .click() calls. React's synthetic event system requires the full pointer/mouse event sequence (pointerdown → mousedown → pointerup → mouseup → click) to properly trigger event handlers. The codebase already uses this pattern for the "Answer now" button, but attemptSendButton was still using .click().

Changes:

  • Update attemptSendButton to dispatch the full mouse event sequence
  • Add InputEvent dispatch after setting editor.textContent so React/ProseMirror recognizes the injected text

When using Oracle in browser mode, prompts would be correctly injected
into ChatGPT's textarea—you could see the text appear—but then nothing
would happen. Oracle would hang indefinitely, waiting for a response
that never came because the send button was never actually triggered.

The root cause: ChatGPT's React-based UI doesn't respond to simple
`.click()` calls. React's synthetic event system requires the full
pointer/mouse event sequence (pointerdown → mousedown → pointerup →
mouseup → click) to properly trigger event handlers. The codebase
already uses this pattern for the "Answer now" button, but
`attemptSendButton` was still using `.click()`.

Changes:
- Update `attemptSendButton` to dispatch the full mouse event sequence
- Add InputEvent dispatch after setting editor.textContent so
  React/ProseMirror recognizes the injected text
@steipete
Copy link
Owner

steipete commented Dec 6, 2025

Thanks, love a focussed commit with a great message. I'll test this and do a new release soon.

Also might extract this into a helper, seems a good idea for any click.

@steipete steipete merged commit de34b96 into steipete:main Dec 6, 2025
4 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