Skip to content

fix: warn on boolean input text indices#4942

Open
he-yufeng wants to merge 1 commit into
browser-use:mainfrom
he-yufeng:fix/warn-bool-action-index
Open

fix: warn on boolean input text indices#4942
he-yufeng wants to merge 1 commit into
browser-use:mainfrom
he-yufeng:fix/warn-bool-action-index

Conversation

@he-yufeng

@he-yufeng he-yufeng commented May 31, 2026

Copy link
Copy Markdown

Summary

Fixes #4796

To verify

  • python -m pytest tests\ci\infrastructure\test_tool_views.py -q
  • python -m ruff check browser_use\tools\views.py tests\ci\infrastructure\test_tool_views.py
  • python -m ruff format --check browser_use\tools\views.py tests\ci\infrastructure\test_tool_views.py

Summary by cubic

Warn when InputTextAction.index is a JSON boolean using a pydantic field_validator (mode='before'), logging a warning while preserving int coercion for compatibility. Adds a regression test that checks the warning and that True/False coerce to 1/0; fixes #4796.

Written for commit bb787f6. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@he-yufeng

Copy link
Copy Markdown
Author

Rebased on current origin/main and reran the scoped validation locally.

Validated:

uv run pytest tests\ci\infrastructure\test_tool_views.py -q --basetemp .tmp\pytest-4942
uv run ruff check browser_use\tools\views.py tests\ci\infrastructure\test_tool_views.py
python -m py_compile browser_use\tools\views.py tests\ci\infrastructure\test_tool_views.py
git diff --check origin/main...HEAD

All passed after the rebase.

@he-yufeng he-yufeng force-pushed the fix/warn-bool-action-index branch 2 times, most recently from 2df57ac to 1f3a03b Compare June 6, 2026 19:56
@he-yufeng

Copy link
Copy Markdown
Author

Rebased this branch onto the latest upstream main and force-pushed the cleaned head.

Validated locally:

  • python -m py_compile browser_use/tools/views.py tests/ci/infrastructure/test_tool_views.py
  • uv run pytest -q tests/ci/infrastructure/test_tool_views.py (1 passed)
  • uv run ruff check browser_use/tools/views.py tests/ci/infrastructure/test_tool_views.py
  • git diff --check origin/main..HEAD

@he-yufeng he-yufeng force-pushed the fix/warn-bool-action-index branch from 1f3a03b to bb787f6 Compare June 12, 2026 11:28
@he-yufeng

Copy link
Copy Markdown
Author

Rebased this branch onto current main and pushed the updated head bb787f63.

Focused validation:

  • python -m py_compile browser_use\tools\views.py tests\ci\infrastructure\test_tool_views.py -> passed
  • ruff check browser_use\tools\views.py tests\ci\infrastructure\test_tool_views.py -> passed
  • ruff format --check browser_use\tools\views.py tests\ci\infrastructure\test_tool_views.py -> passed
  • pytest -q tests\ci\infrastructure\test_tool_views.py -> passed
  • pyright --pythonpath <browser-use .venv python> browser_use\tools\views.py tests\ci\infrastructure\test_tool_views.py -> passed, 0 errors
  • git diff --check origin/main..HEAD -> 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.

bu-2-0 emits {input_text: {index: true}} (boolean) instead of integer on auth0-style login pages (✨)

1 participant