Skip to content

Capitalize sign-in error reasons before reporting them - #6

Merged
paydii merged 1 commit into
mainfrom
fix/auth-error-capitalization
Nov 5, 2026
Merged

paydii merged 1 commit into
mainfrom
fix/auth-error-capitalization

Conversation

@setoelkahfi

Copy link
Copy Markdown
Contributor

Summary

Sign-in error reasons were embedded mid-sentence ("Sign-in did not complete ({reason}). Try again, …"). Clients such as Zed prepend their own lead-in ("Sign-in did not complete:"), so the message read as a duplicated, awkwardly-cased sentence.

This PR reports the reason as a standalone, capitalized sentence instead:

  • authenticate failure: "{Reason}. Try again, or run \onde-code --setup` in a terminal to paste a key."`
  • browser_auth::begin failure: "{Reason}. Run \onde-code --setup` in a terminal to paste a key instead."`

Adds a small capitalize helper that uppercases only the first character (Unicode-aware via to_uppercase).

Testing

  • New unit test capitalize_uppercases_only_the_first_character (covers already-capitalized input, Unicode élan → Élan, and empty string).
  • cargo fmt --check clean; cargo test in crates/agent — 18 passed, 0 failed.

Clients such as Zed prepend their own lead-in ("Sign-in did not
complete:"), so embedding the reason in a second sentence read
awkwardly. Report the reason as a standalone, capitalized sentence
instead.

Co-Authored-By: OndeCode v1.1.1-acp <noreply@ondeinference.com>
@setoelkahfi setoelkahfi self-assigned this Nov 5, 2026
@setoelkahfi
setoelkahfi requested a review from paydii November 5, 2026 16:41

@sigit-code-review sigit-code-review 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.

This change reworks sign-in error messages so the reason reads as a standalone, capitalized sentence instead of being embedded mid-sentence. The authenticate and browser_auth::begin error paths now call a new capitalize helper that uppercases only the first character (Unicode-aware via to_uppercase), and a unit test covers already-capitalized input, Unicode (élan → Élan), and the empty string. The helper and message rewrites are correct and well-tested; the empty-string case is explicitly covered by the test and yields a leading period, which is an acceptable edge case for an error reason that is never empty in practice.


Automated review by siGit Code Review · commit 71f75f8 · see the review dashboard

@paydii
paydii merged commit 1a89e54 into main Nov 5, 2026
5 checks passed
@foodandtravel
foodandtravel deleted the fix/auth-error-capitalization branch November 8, 2026 16:40
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