Skip to content

Conversation

singhpta
Copy link
Contributor

Summary

Add client-side validation to prevent service-side 4xx errors when generating browser live view URLs with invalid expiry timeouts.

Changes

  • Add validation in generate_live_view_url() to ensure expiry_timeout_seconds cannot exceed 300 seconds
  • Raise ValueError with descriptive message when timeout exceeds the limit
  • Add comprehensive test coverage for the new validation logic

Why this change?

Prevents users from encountering confusing 4xx errors from the service by catching invalid timeout values early on the client side.

Files Changed

  • src/bedrock_agentcore/tools/browser_client.py - Added validation logic
  • tests/bedrock_agentcore/tools/test_browser_client.py - Added test cases

Testing

  • Added unit tests to verify validation works correctly
  • Tests cover both valid and invalid timeout scenarios

Prevent service-side 4xx errors by validating that expiry timeout
cannot exceed 300 seconds in generate_live_view_url().
@singhpta singhpta merged commit 9653a1f into main Aug 19, 2025
19 checks 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.

2 participants