Skip to content

Agent: Stop Return in the OAuth paste field from crashing the app - #1591

Merged
AnthonyRonning merged 2 commits into
masterfrom
fix/oauth-enter-crash
Nov 17, 2026
Merged

AnthonyRonning merged 2 commits into
masterfrom
fix/oauth-enter-crash

Conversation

@matthewrball

@matthewrball matthewrball commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

  • Pressing Return in the "Paste the URL you were redirected to" field no longer quits the app. It confirms the sign-in, like the button does.
  • This affected sign-in with GitHub, Google and Apple. Clicking the button already worked.
  • Only unpackaged builds show this field. Packaged Dev and Prod builds sign in through hosted OAuth, so released apps were not affected.

Fixes #1632

Notes

  • The field's Enter handler ignored the text it was handed, and confirm_oauth read the field back while gpui still held it for the key event. That read panics, and inside a macOS key callback the panic aborts the process. confirm_oauth now takes the pasted text: Enter passes its argument, and the button reads the field.
  • Seen twice in a real run during Google sign-in: cannot read ui::text_input::TextInput while it is already being updated.
  • The other Enter handlers were checked. Email and account id already pass their own text. Password goes through SecretInput's submission event; its existing Enter tests pass.
  • No screenshots: nothing visible changes.
  • Test: oauth_paste_enter_confirms_without_reentrant_field_access presses Return in the field, empty and with a URL. It panics without the fix.
  • Checked on macOS with Rust 1.98: just ci-lint and cargo test -p maple-agent-app --locked pass. Partial verification: just ci-test was not run to the end here; on this Mac it fails 65 store and external-agent tests in crates/maple-agent, which this PR does not touch. The fix was not re-tried with a real sign-in.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The paste field's Enter handler ignored the text it was handed and
confirm_oauth read the input back while gpui still held it for the
key event. That read panics, and inside a macOS key callback the
panic aborts the process. confirm_oauth now takes the redirected
text: Enter passes its argument, the button reads the field.
The comment blamed an unreachable backend. The completion fails before
any network call, because the test never began a sign-in.
@matthewrball
matthewrball marked this pull request as ready for review November 17, 2026 22:12
@AnthonyRonning
AnthonyRonning merged commit c4b2cba into master Nov 17, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the fix/oauth-enter-crash branch November 17, 2026 22:47
AnthonyRonning added a commit that referenced this pull request Nov 18, 2026
…app (#1635)

The field's Enter handler called erase_local_store, which read the field
back while gpui still held it for the key event. That read panics, and
inside a macOS key callback the panic aborts the process. The handler
now passes the text it is handed; the button and the Vim target still
read the field.

Same cause as the OAuth paste field fixed in #1591.

Co-authored-by: Claude <[email protected]>
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.

Agent: Return in the pasted sign-in URL field quits the app (unpackaged builds)

2 participants