Skip to content

fix(browser): add missing PressKeyAction dispatch case#507

Open
wangwangbobo wants to merge 4 commits into
strands-agents:mainfrom
wangwangbobo:fix-presskey-dispatch
Open

fix(browser): add missing PressKeyAction dispatch case#507
wangwangbobo wants to merge 4 commits into
strands-agents:mainfrom
wangwangbobo:fix-presskey-dispatch

Conversation

@wangwangbobo

Copy link
Copy Markdown
Contributor

Summary

Fixes PressKeyAction silently failing with "Unknown action type" error.

Root Cause

The press_key() method was fully implemented at line 513 but never wired into the dispatch logic. The browser() method jumped from TypeAction directly to GetTextAction, skipping PressKeyAction.

Fix

Added 2-line dispatch case between TypeAction and GetTextAction:

elif isinstance(action, PressKeyAction):
    return self.press_key(action)

Testing

  • press_key() method already exists and is correctly implemented (lines 513-533)
  • PressKeyAction is already imported and defined in models.py
  • This is purely a missing routing case — the handler code was already there

Fixes #350

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.

Browser tool: PressKeyAction not handled in dispatch logic

1 participant