Skip to content

feat: add name parameter to browser_session() and SessionConfiguration#326

Merged
jariy17 merged 1 commit into
aws:mainfrom
kevin-orellana:feat/browser-session-name
Mar 12, 2026
Merged

feat: add name parameter to browser_session() and SessionConfiguration#326
jariy17 merged 1 commit into
aws:mainfrom
kevin-orellana:feat/browser-session-name

Conversation

@kevin-orellana

@kevin-orellana kevin-orellana commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add name: Optional[str] parameter to browser_session() context manager, passing it through to BrowserClient.start()
  • Add name: Optional[str] field to SessionConfiguration dataclass with to_dict() support
  • The AWS API and BrowserClient.start() already support name, but these two SDK helper surfaces were missing it

Motivation

Customers want browser session names configurable in the SDK. This closes that gap so customers can label sessions via the context manager and configuration dataclass.

Test plan

  • Unit tests: 4 new tests added (name-only, name+all params, SessionConfiguration with name, SessionConfiguration with name+viewport)
  • All 53 unit tests pass (pytest tests/bedrock_agentcore/tools/test_browser_client.py)
  • Integration test: new Test 3 creates a real session with name="sdk-integ-test-session" and verifies get_session() returns it
  • All 3 integration tests pass (python tests_integ/tools/test_browser.py)

…ration`

The AWS API and BrowserClient.start() already support session names,
but the browser_session() context manager and SessionConfiguration
dataclass did not expose this parameter. This adds name passthrough
so customers can label sessions for visibility in the console.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@2afa155). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #326   +/-   ##
=======================================
  Coverage        ?   90.84%           
=======================================
  Files           ?       42           
  Lines           ?     4041           
  Branches        ?      622           
=======================================
  Hits            ?     3671           
  Misses          ?      203           
  Partials        ?      167           
Flag Coverage Δ
unittests 90.84% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kevin-orellana kevin-orellana marked this pull request as ready for review March 12, 2026 02:37
@kevin-orellana kevin-orellana requested a review from a team March 12, 2026 02:37
@jariy17 jariy17 merged commit 1ec1a62 into aws:main Mar 12, 2026
17 of 20 checks passed
@kevin-orellana kevin-orellana deleted the feat/browser-session-name branch March 12, 2026 05:22
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.

4 participants