fix: ensure note_login uses headful mode for manual login#249
Merged
Conversation
The login_with_browser function was using the default headless mode from the NOTE_MCP_TEST_HEADLESS environment variable, which defaults to True (headless). This caused the browser window to never appear, making manual login impossible and causing timeouts. Changes: - Add headless parameter to BrowserManager.get_page() and _ensure_browser() - Call get_page(headless=False) in login_with_browser to ensure browser is visible - Add tests for headless parameter support Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add debug logging to browser cleanup methods instead of silent pass - Limit RuntimeError catch to specific "no event loop" messages - Improve get_page() docstring with IMPORTANT warning about existing browser - Raise profile navigation error log level from debug to warning - Add test for headless parameter ignored when browser exists - Add test verifying close() is called before get_page() in login flow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
note_loginが headless モードで起動し、ブラウザウィンドウが表示されない問題を修正BrowserManager.get_page()にheadlessパラメータを追加login_with_browser()でheadless=Falseを指定してブラウザを表示Test plan
note_logoutを実行してセッションをクリアnote_loginを実行してブラウザウィンドウが表示されることを確認uv run pytest tests/unit/test_browser_manager.py tests/integration/test_auth_flow.py -vでテストがパスすることを確認🤖 Generated with Claude Code