feat(agentcore): enhance Browser & Code Interpreter toolkits with full session config, new tools, and telemetry#4882
Open
kevin-orellana wants to merge 2 commits intocrewAIInc:mainfrom
Conversation
13e2d95 to
746fb54
Compare
lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_session_manager.py
Outdated
Show resolved
Hide resolved
5bfb5fa to
e23da7d
Compare
Author
|
Fixed in e23da7d — changed |
lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_session_manager.py
Show resolved
Hide resolved
lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_session_manager.py
Outdated
Show resolved
Hide resolved
8313b9c to
7729b5c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_session_manager.py
Show resolved
Hide resolved
…ols for Browser & Code Interpreter - Add integration_source="crewai" telemetry to BrowserClient and CodeInterpreter - Add identifier param for custom browser/code interpreter sandbox selection - Browser: add GenerateLiveViewUrl, TakeControl, ReleaseControl tools - Browser: fix CDP reconnect after release_control() invalidates connection - Code Interpreter: add UploadFile, UploadFiles, InstallPackages, DownloadFile, DownloadFiles, ClearContext tools - 59 unit tests (30 browser + 29 code interpreter)
98c7f16 to
f4b7029
Compare
…gbot findings New .mdx doc pages for BrowserToolkit and CodeInterpreterToolkit with navigation entries, overview cards, verified install instructions, and end-to-end tested code examples. Also addresses Cursor Bugbot findings in browser_session_manager.py: - Extract duplicated start_kwargs construction into _build_start_kwargs() - Prevent corrupt session state on reconnect failure by removing dead session entries before re-raising
f4b7029 to
d4dd9dd
Compare
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
Enhances the AWS Bedrock AgentCore Browser and Code Interpreter toolkits to expose the full SDK feature surface — session configuration with typed dataclass support, new tool capabilities, and telemetry tracking.
Telemetry
integration_source="crewai"toBrowserClientandCodeInterpreterconstructors for customer acquisition tracking via User-Agent headerSession Configuration Passthrough (with SDK Typed Dataclass Support)
Expose all
start()parameters so users can configure sessions at toolkit creation time. Previously onlyidentifierwas supported — all other SDK options were silently ignored.All config parameters accept both SDK typed dataclasses and plain dicts, matching the SDK's own
BrowserClient.start()signature. Typed dataclasses give users IDE autocomplete, validation at construction time, and convenience factory methods.Browser — 5 new params on
BrowserToolkit/create_browser_toolkit():session_timeout_seconds— session timeout in seconds (1–28800, default 3600)viewport—ViewportConfigurationor dict. Factory methods:.desktop_hd(),.laptop(),.mobile(), etc.proxy_configuration—ProxyConfigurationor dict. Proxy routing with optional auth via Secrets Managerextensions—list[BrowserExtension | dict]. S3-hosted browser extensionsprofile_configuration—ProfileConfigurationor dict. Persist cookies/local storage across sessionsCode Interpreter — 1 new param on
CodeInterpreterToolkit/create_code_interpreter_toolkit():session_timeout_seconds— session timeout in seconds (default 900)All params default to
None(SDK defaults apply). No validation on our side — the SDK handles it.Custom Sandbox Identifier
identifierparameter toBrowserToolkit,CodeInterpreterToolkit, andBrowserSessionManagerfor custom browser/interpreter resources (VPC, recording, Web Bot Auth).start(identifier=...)on the underlying SDK clientsNew Browser Tools (3)
GenerateLiveViewUrlTool— generate a presigned URL for live browser viewingTakeControlTool— take manual control of the browser (disables automation)ReleaseControlTool— release manual control (re-enables automation, reconnects Playwright)New Code Interpreter Tools (6)
UploadFileTool/UploadFilesTool— upload files with optional semantic descriptionsDownloadFileTool/DownloadFilesTool— download files from the sandboxInstallPackagesTool— install pip packages with optional--upgradeflagClearContextTool— reset the Python execution contextBrowser Session Manager
reconnect_sync_browser()/reconnect_async_browser()for CDP reconnection afterrelease_control()get_browser_client()/get_async_browser_client()accessors for the underlyingBrowserClientUsage Examples
Test Plan
1920x1080returned in session API response600sapplied correctly1800sapplied correctlyNote
Medium Risk
Modifies AgentCore Browser/Code Interpreter session lifecycle and configuration passthrough (including reconnection behavior), which could impact remote session stability and resource cleanup. Changes are covered by new unit tests but touch threaded/async session management and SDK start kwargs.
Overview
Adds new Amazon Bedrock AgentCore documentation pages (EN/KO) and navigation entries for AgentCore Browser, AgentCore Code Interpreter, and an AgentCore Overview.
Extends the AgentCore
BrowserToolkitandCodeInterpreterToolkitto pass through additional SDK session configuration (e.g.,session_timeout_seconds,viewport,proxy_configuration,extensions,profile_configuration, plusidentifier), and tags SDK client creation withintegration_source="crewai".Introduces new browser tools for human oversight/control (including
generate_live_view_url,take_control,release_controlwith Playwright reconnection) and new code-interpreter tools for file transfer, package install, and context reset. Adds comprehensive unit tests for the new capabilities and config passthrough.Written by Cursor Bugbot for commit d4dd9dd. This will update automatically on new commits. Configure here.