Fix gateway auth and Telegram pairing flow handling - #2594
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the extension authentication and onboarding flow to improve state management and user experience. Key changes include the introduction of a block_chat flag in handleAuthRequired to conditionally disable the chat interface, and the migration of several components to use handleAuthRequired instead of calling showAuthCard directly. Additionally, the onboarding logic now ensures the settings tab is refreshed upon state changes, and the end-to-end tests have been updated to use dynamic thread IDs and cover new scenarios, such as authentication requests for foreign threads and race conditions between setup responses and SSE events. I have no feedback to provide as there were no review comments to assess.
There was a problem hiding this comment.
Pull request overview
Updates the gateway UI and E2E coverage to align unified auth + Telegram pairing with the authoritative onboarding SSE stream, preserving pairing request/thread identifiers and avoiding unnecessary chat input blocking during settings-initiated OAuth.
Changes:
- Make
handleAuthRequiredoptionally not disable chat input (viablock_chat: false) for settings-driven OAuth flows. - Treat onboarding SSE as the source of truth for pairing-required transitions (including request/thread IDs), and refresh settings when pairing state arrives while on the settings tab.
- Realign Playwright E2E tests around current thread scoping, pairing payloads (
thread_id,request_id), and the “SSE wins over setup response” regression.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/e2e/scenarios/test_telegram_hot_activation.py |
Adds thread-aware onboarding simulations and a new regression test ensuring SSE request IDs override setup responses for pairing. |
tests/e2e/scenarios/test_extensions.py |
Updates auth/pairing E2E expectations to include thread scoping and verifies chat input remains enabled for settings-initiated OAuth. |
crates/ironclaw_gateway/static/app.js |
Introduces block_chat gating for auth prompts, refreshes settings on pairing-required SSE in settings, and routes settings OAuth through handleAuthRequired (without blocking chat). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary:
Testing: