diff --git a/docs/en/DEPLOY_OPTION.md b/docs/en/DEPLOY_OPTION.md index 26faa3935..e26f36d4e 100644 --- a/docs/en/DEPLOY_OPTION.md +++ b/docs/en/DEPLOY_OPTION.md @@ -755,6 +755,8 @@ This is a use case for integrating with agents created in AgentCore. (Experiment Enabling `createGenericAgentCoreRuntime` will deploy the default AgentCore Runtime. By default, it is deployed to `modelRegion`, but you can override it by specifying `agentCoreRegion`. +Setting `agentCoreCodeInterpreterEnabled` to `true` enables Code Interpreter in AgentCore Chat. This allows the agent to execute Python code and shell commands within a sandboxed environment. Note that the Code Interpreter sandbox is isolated from the host filesystem — files created in the sandbox are not accessible to MCP tools, and vice versa. + The default agents available in AgentCore can use MCP servers defined in [generic/mcp.json](packages/cdk/lambda-python/generic-agent-core-runtime/mcp-configs/generic/mcp.json). The MCP servers defined by default are AWS-related MCP servers and MCP servers related to current time. @@ -801,6 +803,7 @@ To enable the AgentCore use case, the `docker` command must be executable. const envs: Record> = { dev: { createGenericAgentCoreRuntime: true, + agentCoreCodeInterpreterEnabled: true, agentCoreRegion: 'us-west-2', agentCoreGatewayArns: [ 'arn:aws:bedrock-agentcore:us-west-2::gateway/', @@ -825,6 +828,7 @@ const envs: Record> = { { "context": { "createGenericAgentCoreRuntime": true, + "agentCoreCodeInterpreterEnabled": true, "agentCoreRegion": "us-west-2", "agentCoreGatewayArns": [ "arn:aws:bedrock-agentcore:us-west-2::gateway/" diff --git a/docs/ja/DEPLOY_OPTION.md b/docs/ja/DEPLOY_OPTION.md index 03b3bd672..a6990884a 100644 --- a/docs/ja/DEPLOY_OPTION.md +++ b/docs/ja/DEPLOY_OPTION.md @@ -774,6 +774,8 @@ AgentCore で作成したエージェントと連携するユースケースで `createGenericAgentCoreRuntime` を有効化するとデフォルトの AgentCore Runtime がデプロイされます。 デフォルトでは `modelRegion` にデプロイされますが、`agentCoreRegion` を指定し上書きすることが可能です。 +`agentCoreCodeInterpreterEnabled` を `true` にすると、AgentCore チャットで Code Interpreter が有効になります。エージェントがサンドボックス環境内で Python コードやシェルコマンドを実行できるようになります。なお、Code Interpreter のサンドボックスはホストのファイルシステムとは分離されており、サンドボックス内で作成したファイルは MCP ツールからアクセスできません(逆も同様です)。 + AgentCore で使用できるデフォルトのエージェントは、[generic/mcp.json](packages/cdk/lambda-python/generic-agent-core-runtime/mcp-configs/generic/mcp.json) で定義する MCP サーバーを利用することができます。 デフォルトで定義されている MCP サーバーは、AWS に関連する MCP サーバー及び、現在時刻に関連する MCP サーバーです。 @@ -820,6 +822,7 @@ AgentCore ユースケースを有効化するためには、`docker` コマン const envs: Record> = { dev: { createGenericAgentCoreRuntime: true, + agentCoreCodeInterpreterEnabled: true, agentCoreRegion: 'us-west-2', agentCoreGatewayArns: [ 'arn:aws:bedrock-agentcore:us-west-2::gateway/', @@ -844,6 +847,7 @@ const envs: Record> = { { "context": { "createGenericAgentCoreRuntime": true, + "agentCoreCodeInterpreterEnabled": true, "agentCoreRegion": "us-west-2", "agentCoreGatewayArns": [ "arn:aws:bedrock-agentcore:us-west-2::gateway/" diff --git a/packages/cdk/cdk.json b/packages/cdk/cdk.json index ffb5bf128..9dfc160bf 100644 --- a/packages/cdk/cdk.json +++ b/packages/cdk/cdk.json @@ -65,6 +65,7 @@ "flows": [], "agentBuilderEnabled": false, "createGenericAgentCoreRuntime": false, + "agentCoreCodeInterpreterEnabled": false, "agentCoreRegion": null, "agentCoreExternalRuntimes": [], "agentCoreVpcId": null, diff --git a/packages/cdk/lambda-python/generic-agent-core-runtime/src/agent.py b/packages/cdk/lambda-python/generic-agent-core-runtime/src/agent.py index b63fbae46..dc8604bcc 100644 --- a/packages/cdk/lambda-python/generic-agent-core-runtime/src/agent.py +++ b/packages/cdk/lambda-python/generic-agent-core-runtime/src/agent.py @@ -75,6 +75,12 @@ async def process_request_streaming( tools = self.tool_manager.get_tools_with_options(code_execution_enabled=code_execution_enabled, mcp_servers=mcp_servers) logger.info(f"Loaded {len(tools)} tools (code execution: {code_execution_enabled})") + # Inject MCP Server Instructions into system prompt + mcp_instructions = self.tool_manager.get_mcp_instructions() + if mcp_instructions: + combined_system_prompt += f"\n\n## MCP Server Instructions\n\n{mcp_instructions}" + logger.info(f"Injected MCP Server Instructions ({len(mcp_instructions)} chars) into system prompt") + # Log agent info if agent_id: logger.debug(f"Processing agent: {agent_id}") diff --git a/packages/cdk/lambda-python/generic-agent-core-runtime/src/config.py b/packages/cdk/lambda-python/generic-agent-core-runtime/src/config.py index 594f9d1bb..25b3ba8bb 100644 --- a/packages/cdk/lambda-python/generic-agent-core-runtime/src/config.py +++ b/packages/cdk/lambda-python/generic-agent-core-runtime/src/config.py @@ -15,13 +15,14 @@ WORKSPACE_DIR = "/tmp/ws" -DEFAULT_MAX_ITERATIONS = 20 +DEFAULT_MAX_ITERATIONS = 100 FIXED_SYSTEM_PROMPT = f"""## About File Output - You are running on AWS Bedrock AgentCore. Therefore, when writing files, always write them under `{WORKSPACE_DIR}`. - Similarly, if you need a workspace, please use the `{WORKSPACE_DIR}` directory. Do not ask the user about their current workspace. It's always `{WORKSPACE_DIR}`. - Also, users cannot directly access files written under `{WORKSPACE_DIR}`. So when submitting these files to users, *always upload them to S3 using the `upload_file_to_s3_and_retrieve_s3_url` tool and provide the S3 URL*. The S3 URL must be included in the final output. - If the output file is an image file, the S3 URL output must be in Markdown format. +- For all other file types (e.g. .pptx, .csv, .pdf), the S3 URL must also be in Markdown link format: `[filename](S3_URL)`. This enables the UI to generate a download link. """ diff --git a/packages/cdk/lambda-python/generic-agent-core-runtime/src/tools.py b/packages/cdk/lambda-python/generic-agent-core-runtime/src/tools.py index e74c9c5ea..18a104c4f 100644 --- a/packages/cdk/lambda-python/generic-agent-core-runtime/src/tools.py +++ b/packages/cdk/lambda-python/generic-agent-core-runtime/src/tools.py @@ -51,6 +51,7 @@ class ToolManager: def __init__(self): self.mcp_tools = None + self.mcp_instructions: list[str] = [] self.session_id = None self.trace_id = None @@ -89,6 +90,13 @@ def load_mcp_tools(self) -> list[Any]: # Flatten the tools self.mcp_tools = sum([c.list_tools_sync() for c in mcp_clients], []) + + # Collect server instructions from MCP servers + for client in mcp_clients: + if hasattr(client, "server_instructions") and client.server_instructions: + logger.info(f"Collected server instructions ({len(client.server_instructions)} chars)") + self.mcp_instructions.append(client.server_instructions) + logger.info(f"Loaded {len(self.mcp_tools)} MCP tools") return self.mcp_tools @@ -131,6 +139,13 @@ def load_mcp_tools_by_names(self, server_names: list[str]) -> list[Any]: # Flatten the tools dynamic_tools = sum([c.list_tools_sync() for c in mcp_clients], []) + + # Collect server instructions from dynamically loaded MCP servers + for client in mcp_clients: + if hasattr(client, "server_instructions") and client.server_instructions: + logger.info(f"Collected server instructions ({len(client.server_instructions)} chars)") + self.mcp_instructions.append(client.server_instructions) + logger.info(f"Loaded {len(dynamic_tools)} MCP tools from {len(mcp_clients)} servers") return dynamic_tools @@ -176,6 +191,123 @@ def upload_file_to_s3_and_retrieve_s3_url(filepath: str) -> str: return upload_file_to_s3_and_retrieve_s3_url + def get_file_write_tool(self): + """Get the file write tool scoped to WORKSPACE_DIR""" + + @tool + def write_file(filepath: str, content: str, mode: str = "create", old_str: str = "", new_str: str = "") -> str: + """Write, append, or edit a file under /tmp/ws. + + Args: + filepath: Path to the file (must be under /tmp/ws). + content: Text content to write (for create/append modes). + mode: "create" to create/overwrite, "append" to append, "str_replace" to replace text. + old_str: Text to find (required for str_replace mode). Must match exactly once. + new_str: Replacement text (for str_replace mode). Empty string to delete. + """ + filepath = os.path.normpath(filepath) + if not filepath.startswith(WORKSPACE_DIR): + raise ValueError(f"Path must be under {WORKSPACE_DIR}. Got: {filepath}") + os.makedirs(os.path.dirname(filepath), exist_ok=True) + + if mode == "str_replace": + if not old_str: + raise ValueError("old_str is required for str_replace mode") + with open(filepath, encoding="utf-8") as f: + text = f.read() + count = text.count(old_str) + if count == 0: + raise ValueError(f"old_str not found in {filepath}") + if count > 1: + raise ValueError(f"old_str found {count} times in {filepath}. Must be unique.") + text = text.replace(old_str, new_str, 1) + with open(filepath, "w", encoding="utf-8") as f: + f.write(text) + return f"Replaced in {filepath}" + else: + flag = "a" if mode == "append" else "w" + with open(filepath, flag, encoding="utf-8") as f: + f.write(content) + return f"Wrote {len(content)} chars to {filepath} (mode={mode})" + + return write_file + + def get_concat_files_tool(self): + """Get the file concatenation tool scoped to WORKSPACE_DIR""" + + @tool + def concat_files(source_paths: list[str], destination: str) -> str: + """Concatenate multiple files into one. All paths must be under /tmp/ws. + + Args: + source_paths: List of file paths to concatenate in order. + destination: Output file path. + """ + for p in source_paths + [destination]: + normed = os.path.normpath(p) + if not normed.startswith(WORKSPACE_DIR): + raise ValueError(f"Path must be under {WORKSPACE_DIR}. Got: {p}") + with open(os.path.normpath(destination), "w", encoding="utf-8") as out: + for p in source_paths: + with open(os.path.normpath(p), encoding="utf-8") as f: + out.write(f.read()) + return f"Concatenated {len(source_paths)} files into {destination}" + + return concat_files + + def get_web_fetch_tool(self): + """Get the web fetch tool""" + + @tool + def web_fetch(url: str, max_chars: int = 50000) -> str: + """Fetch text content from a URL. Useful for reading web pages, documentation, or API responses. + + Args: + url: The URL to fetch. + max_chars: Maximum characters to return (default 50000). + """ + import urllib.request + + req = urllib.request.Request(url, headers={"User-Agent": "GenU-AgentCore/1.0"}) + with urllib.request.urlopen(req, timeout=30) as resp: + content_type = resp.headers.get("Content-Type", "") + raw = resp.read().decode("utf-8", errors="replace") + + # Strip HTML tags for readability if HTML + if "html" in content_type: + from html.parser import HTMLParser + + class _TextExtractor(HTMLParser): + def __init__(self): + super().__init__() + self._parts: list[str] = [] + self._skip = False + + def handle_starttag(self, tag, attrs): + if tag in ("script", "style"): + self._skip = True + + def handle_endtag(self, tag): + if tag in ("script", "style"): + self._skip = False + + def handle_data(self, data): + if not self._skip: + self._parts.append(data) + + extractor = _TextExtractor() + extractor.feed(raw) + raw = " ".join(extractor._parts) + import re + + raw = re.sub(r"\s+", " ", raw).strip() + + if len(raw) > max_chars: + raw = raw[:max_chars] + f"\n\n[Truncated at {max_chars} chars]" + return raw + + return web_fetch + def get_code_interpreter_tool(self) -> list[Any]: """Get code interpreter tool if available""" code_interpreter_tools = [] @@ -192,6 +324,20 @@ def get_code_interpreter_tool(self) -> list[Any]: return code_interpreter_tools + def get_mcp_instructions(self) -> str: + """Return collected MCP Server Instructions as a single string. + + Server Instructions are provided by MCP servers during initialization + to guide the LLM on how to use their tools effectively. + See: https://modelcontextprotocol.io/specification/2025-11-25/basic/lifecycle#initialization + + Returns: + Combined instructions from all connected MCP servers, or empty string if none. + """ + if not self.mcp_instructions: + return "" + return "\n\n---\n\n".join(inst.strip() for inst in self.mcp_instructions) + def get_tools_with_options(self, code_execution_enabled: bool = False, mcp_servers=None) -> list[Any]: """ Get tools with optional code execution and MCP servers. @@ -233,7 +379,13 @@ def get_tools_with_options(self, code_execution_enabled: bool = False, mcp_serve # Add built-in tools (always included) upload_tool = self.get_upload_tool() + file_write_tool = self.get_file_write_tool() + concat_tool = self.get_concat_files_tool() + web_fetch_tool = self.get_web_fetch_tool() all_tools.append(upload_tool) + all_tools.append(file_write_tool) + all_tools.append(concat_tool) + all_tools.append(web_fetch_tool) # Add code interpreter tools if enabled code_interpreter_tools = [] @@ -242,6 +394,6 @@ def get_tools_with_options(self, code_execution_enabled: bool = False, mcp_serve all_tools.extend(code_interpreter_tools) # Log final tool count - logger.info(f"Total tools loaded: {len(all_tools)} (MCP: {len(mcp_tools)}, Built-in: 1, Code Interpreter: {len(code_interpreter_tools)} - {'enabled' if code_execution_enabled else 'disabled'})") + logger.info(f"Total tools loaded: {len(all_tools)} (MCP: {len(mcp_tools)}, Built-in: 4, Code Interpreter: {len(code_interpreter_tools)} - {'enabled' if code_execution_enabled else 'disabled'})") return all_tools diff --git a/packages/cdk/lambda-python/generic-agent-core-runtime/tests/test_mcp_instructions.py b/packages/cdk/lambda-python/generic-agent-core-runtime/tests/test_mcp_instructions.py new file mode 100644 index 000000000..5cb931bf0 --- /dev/null +++ b/packages/cdk/lambda-python/generic-agent-core-runtime/tests/test_mcp_instructions.py @@ -0,0 +1,89 @@ +"""Tests for MCP Server Instructions collection and injection.""" + +from unittest.mock import MagicMock, patch + +from src.tools import ToolManager + + +class TestToolManagerInstructions: + """Test ToolManager's MCP Server Instructions collection.""" + + def test_initial_state_empty(self): + tm = ToolManager() + assert tm.mcp_instructions == [] + assert tm.get_mcp_instructions() == "" + + def test_get_mcp_instructions_single(self): + tm = ToolManager() + tm.mcp_instructions = ["Use tool A before tool B."] + assert tm.get_mcp_instructions() == "Use tool A before tool B." + + def test_get_mcp_instructions_multiple(self): + tm = ToolManager() + tm.mcp_instructions = [ + "Server 1: Always call init first.", + "Server 2: Rate limit is 10 req/min.", + ] + result = tm.get_mcp_instructions() + assert "Server 1: Always call init first." in result + assert "Server 2: Rate limit is 10 req/min." in result + assert "\n\n---\n\n" in result + + def test_get_mcp_instructions_strips_whitespace(self): + tm = ToolManager() + tm.mcp_instructions = [" padded instructions \n"] + assert tm.get_mcp_instructions() == "padded instructions" + + @patch("src.tools._create_mcp_client") + @patch("src.tools.os.environ.get") + @patch("src.tools.os.path.exists") + @patch("builtins.open") + def test_load_mcp_tools_collects_instructions(self, mock_open, mock_exists, mock_env_get, mock_create): + """Verify load_mcp_tools collects server_instructions from MCPClients.""" + mock_env_get.return_value = "/tmp/mcp.json" + mock_exists.return_value = True + + import json + + mcp_config = {"mcpServers": {"test-server": {"command": "echo", "args": []}}} + mock_open.return_value.__enter__ = lambda s: s + mock_open.return_value.__exit__ = MagicMock(return_value=False) + mock_open.return_value.read = MagicMock(return_value=json.dumps(mcp_config)) + + mock_client = MagicMock() + mock_client.list_tools_sync.return_value = [] + mock_client.server_instructions = "Always call init before generate." + mock_create.return_value = ("test-server", mock_client) + + tm = ToolManager() + tm.load_mcp_tools() + + assert len(tm.mcp_instructions) == 1 + assert "Always call init before generate." in tm.mcp_instructions[0] + + @patch("src.tools._create_mcp_client") + @patch("src.tools.os.environ.get") + @patch("src.tools.os.path.exists") + @patch("builtins.open") + def test_load_mcp_tools_skips_none_instructions(self, mock_open, mock_exists, mock_env_get, mock_create): + """Verify load_mcp_tools skips servers without instructions.""" + mock_env_get.return_value = "/tmp/mcp.json" + mock_exists.return_value = True + + import json + + mcp_config = {"mcpServers": {"no-inst": {"command": "echo", "args": []}}} + mock_open.return_value.__enter__ = lambda s: s + mock_open.return_value.__exit__ = MagicMock(return_value=False) + mock_open.return_value.read = MagicMock(return_value=json.dumps(mcp_config)) + + mock_client = MagicMock() + mock_client.list_tools_sync.return_value = [] + mock_client.server_instructions = None + mock_create.return_value = ("no-inst", mock_client) + + tm = ToolManager() + tm.load_mcp_tools() + + assert len(tm.mcp_instructions) == 0 + assert tm.get_mcp_instructions() == "" diff --git a/packages/cdk/lambda-python/generic-agent-core-runtime/uv.lock b/packages/cdk/lambda-python/generic-agent-core-runtime/uv.lock index 6f85808c7..f21c2d047 100644 --- a/packages/cdk/lambda-python/generic-agent-core-runtime/uv.lock +++ b/packages/cdk/lambda-python/generic-agent-core-runtime/uv.lock @@ -2277,6 +2277,52 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c0/d2/21af5c535501a7233e734b8af901574572da66fcc254cb35d0609c9080dd/pywin32-311-cp314-cp314-win_arm64.whl", hash = "sha256:a508e2d9025764a8270f93111a970e1d0fbfc33f4153b388bb649b7eec4f9b42", size = 8932540 }, ] +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, + { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, + { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, + { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, + { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, + { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, + { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, + { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, + { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, + { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, + { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, + { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, + { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, + { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, + { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, + { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, + { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, + { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, + { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, +] + [[package]] name = "referencing" version = "0.36.2" @@ -2508,23 +2554,25 @@ wheels = [ [[package]] name = "strands-agents" -version = "1.0.1" +version = "1.34.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "boto3" }, { name = "botocore" }, { name = "docstring-parser" }, + { name = "jsonschema" }, { name = "mcp" }, { name = "opentelemetry-api" }, { name = "opentelemetry-instrumentation-threading" }, { name = "opentelemetry-sdk" }, { name = "pydantic" }, + { name = "pyyaml" }, { name = "typing-extensions" }, { name = "watchdog" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fa/60/a1aae1e7bdf3a314d53f2d1184970e9d1bf3d33e42c8dd10b1f5661f03ac/strands_agents-1.0.1.tar.gz", hash = "sha256:cead5d738bbaaaa2b39fddd68a63a7bc03b015ac0530447f4956800a5678917a", size = 226442 } +sdist = { url = "https://files.pythonhosted.org/packages/be/22/f958d52a794e508a31ace8b8cbba0379226a98fac9826f3b757f95912b70/strands_agents-1.34.1.tar.gz", hash = "sha256:d1ff614dc364ce54348c24b011bbef6c466a0dd33e19996bd1a4ec4aab846cb1", size = 796829, upload-time = "2026-04-01T20:37:29.755Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/22/81/06cc04f1ed4ec23104d3af29ba76192441620f60eae85795181dcacb8f0a/strands_agents-1.0.1-py3-none-any.whl", hash = "sha256:e28b066165466095848e3df69f6a87b63089728d7f905373279d9515969d5a73", size = 162872 }, + { url = "https://files.pythonhosted.org/packages/19/eb/b0db0fb9ae691d3ed0ac9f9604b60f9154671baf4c61853c0b6607e2a91e/strands_agents-1.34.1-py3-none-any.whl", hash = "sha256:edc5ccd4fbc64bf203ced282083ed011953f628cf8f060e1c88e6a2fd8429f3a", size = 393990, upload-time = "2026-04-01T20:37:27.906Z" }, ] [[package]] diff --git a/packages/cdk/lib/construct/api.ts b/packages/cdk/lib/construct/api.ts index 8c023e146..fac79777a 100644 --- a/packages/cdk/lib/construct/api.ts +++ b/packages/cdk/lib/construct/api.ts @@ -273,6 +273,14 @@ export class Api extends Construct { props.useCaseBuilderTable.grantReadWriteData(apiHandler); } + // Grant read access to additional S3 buckets (e.g., Agent Core file bucket) + // This is required for generating presigned URLs + if (props.additionalS3Buckets) { + props.additionalS3Buckets.forEach((bucket) => { + bucket.grantRead(apiHandler); + }); + } + // Grant S3 access for Transcribe buckets if (props.audioBucket && apiHandler.role) { props.audioBucket.grantReadWrite(apiHandler); diff --git a/packages/cdk/lib/construct/generic-agent-core.ts b/packages/cdk/lib/construct/generic-agent-core.ts index c77a58e98..d714d7c74 100644 --- a/packages/cdk/lib/construct/generic-agent-core.ts +++ b/packages/cdk/lib/construct/generic-agent-core.ts @@ -12,6 +12,7 @@ import { BucketEncryption, } from 'aws-cdk-lib/aws-s3'; import { Subnet, Vpc, SecurityGroup, IVpc, ISubnet } from 'aws-cdk-lib/aws-ec2'; +import { Platform } from 'aws-cdk-lib/aws-ecr-assets'; import { Runtime, RuntimeNetworkConfiguration, @@ -235,7 +236,8 @@ export class GenericAgentCore extends Construct { return new Runtime(this, `${type}AgentCoreRuntime`, { runtimeName: config.name, agentRuntimeArtifact: AgentRuntimeArtifact.fromAsset( - path.join(__dirname, `../../${config.dockerPath}`) + path.join(__dirname, `../../${config.dockerPath}`), + { platform: Platform.LINUX_ARM64 } ), executionRole: role, networkConfiguration: networkConfig, diff --git a/packages/cdk/lib/construct/web.ts b/packages/cdk/lib/construct/web.ts index d451199b9..6d5c5ea02 100644 --- a/packages/cdk/lib/construct/web.ts +++ b/packages/cdk/lib/construct/web.ts @@ -63,6 +63,7 @@ export interface WebProps { readonly mcpServersConfig?: string; readonly webBucket?: s3.Bucket; readonly agentCoreEnabled: boolean; + readonly agentCoreCodeInterpreterEnabled: boolean; readonly agentCoreGenericRuntime?: AgentCoreConfiguration; readonly agentBuilderEnabled: boolean; readonly agentCoreAgentBuilderRuntime?: AgentCoreConfiguration; @@ -299,6 +300,8 @@ export class Web extends Construct { VITE_APP_MCP_ENDPOINT: props.mcpEndpoint ?? '', VITE_APP_MCP_SERVERS_CONFIG: props.mcpServersConfig ?? '', VITE_APP_AGENT_CORE_ENABLED: props.agentCoreEnabled.toString(), + VITE_APP_AGENT_CORE_CODE_INTERPRETER_ENABLED: + props.agentCoreCodeInterpreterEnabled.toString(), VITE_APP_AGENT_CORE_GENERIC_RUNTIME: JSON.stringify( props.agentCoreGenericRuntime ), diff --git a/packages/cdk/lib/generative-ai-use-cases-stack.ts b/packages/cdk/lib/generative-ai-use-cases-stack.ts index fa5006da4..30c044f58 100644 --- a/packages/cdk/lib/generative-ai-use-cases-stack.ts +++ b/packages/cdk/lib/generative-ai-use-cases-stack.ts @@ -363,6 +363,7 @@ export class GenerativeAiUseCasesStack extends Stack { agentCoreEnabled: params.createGenericAgentCoreRuntime || params.agentCoreExternalRuntimes.length > 0, + agentCoreCodeInterpreterEnabled: params.agentCoreCodeInterpreterEnabled, agentCoreGenericRuntime: genericRuntimeArn ? { name: genericRuntimeName || 'GenericAgentCoreRuntime', diff --git a/packages/cdk/lib/stack-input.ts b/packages/cdk/lib/stack-input.ts index 4b546419e..de899e739 100644 --- a/packages/cdk/lib/stack-input.ts +++ b/packages/cdk/lib/stack-input.ts @@ -152,6 +152,7 @@ const baseStackInputSchema = z.object({ // Agent Core Runtime agentBuilderEnabled: z.boolean().default(false), createGenericAgentCoreRuntime: z.boolean().default(false), + agentCoreCodeInterpreterEnabled: z.boolean().default(false), agentCoreRegion: z.string().nullish(), agentCoreGatewayArns: z.array(z.string()).nullish(), agentCoreExternalRuntimes: z diff --git a/packages/cdk/test/__snapshots__/generative-ai-use-cases.test.ts.snap b/packages/cdk/test/__snapshots__/generative-ai-use-cases.test.ts.snap index a63964828..ae3919d1d 100644 --- a/packages/cdk/test/__snapshots__/generative-ai-use-cases.test.ts.snap +++ b/packages/cdk/test/__snapshots__/generative-ai-use-cases.test.ts.snap @@ -14,6 +14,17 @@ exports[`GenerativeAiUseCases matches the snapshot (AgentCore with VPC) 1`] = ` "AgentBuilderAgentCoreRuntimeName": { "Value": "GenUAgentBuilderRuntime", }, + "ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A": { + "Export": { + "Name": "AgentCoreStack:ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A", + }, + "Value": { + "Fn::GetAtt": [ + "GenericAgentCoreAgentCoreFileBucket0430DA42", + "Arn", + ], + }, + }, "ExportsOutputRefGenericAgentCoreAgentCoreFileBucket0430DA423298A79F": { "Export": { "Name": "AgentCoreStack:ExportsOutputRefGenericAgentCoreAgentCoreFileBucket0430DA423298A79F", @@ -4510,6 +4521,17 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 4`] = ` "AgentBuilderAgentCoreRuntimeName": { "Value": "GenUAgentBuilderRuntime", }, + "ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A": { + "Export": { + "Name": "AgentCoreStack:ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A", + }, + "Value": { + "Fn::GetAtt": [ + "GenericAgentCoreAgentCoreFileBucket0430DA42", + "Arn", + ], + }, + }, "ExportsOutputRefGenericAgentCoreAgentCoreFileBucket0430DA423298A79F": { "Export": { "Name": "AgentCoreStack:ExportsOutputRefGenericAgentCoreAgentCoreFileBucket0430DA423298A79F", @@ -6435,6 +6457,30 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = ` }, ], }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::ImportValue": "AgentCoreStack:ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A", + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::ImportValue": "AgentCoreStack:ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A", + }, + "/*", + ], + ], + }, + ], + }, { "Action": [ "s3:GetObject*", @@ -13363,6 +13409,7 @@ exports[`GenerativeAiUseCases matches the snapshot (closed network mode) 6`] = ` ], ], }, + "VITE_APP_AGENT_CORE_CODE_INTERPRETER_ENABLED": "false", "VITE_APP_AGENT_CORE_ENABLED": "true", "VITE_APP_AGENT_CORE_EXTERNAL_RUNTIMES": "[]", "VITE_APP_AGENT_CORE_GENERIC_RUNTIME": { @@ -18373,6 +18420,17 @@ exports[`GenerativeAiUseCases matches the snapshot 4`] = ` "AgentBuilderAgentCoreRuntimeName": { "Value": "GenUAgentBuilderRuntime", }, + "ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A": { + "Export": { + "Name": "AgentCoreStack:ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A", + }, + "Value": { + "Fn::GetAtt": [ + "GenericAgentCoreAgentCoreFileBucket0430DA42", + "Arn", + ], + }, + }, "ExportsOutputRefGenericAgentCoreAgentCoreFileBucket0430DA423298A79F": { "Export": { "Name": "AgentCoreStack:ExportsOutputRefGenericAgentCoreAgentCoreFileBucket0430DA423298A79F", @@ -20240,6 +20298,30 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = ` }, ], }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::ImportValue": "AgentCoreStack:ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A", + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::ImportValue": "AgentCoreStack:ExportsOutputFnGetAttGenericAgentCoreAgentCoreFileBucket0430DA42Arn42B9071A", + }, + "/*", + ], + ], + }, + ], + }, { "Action": [ "s3:GetObject*", @@ -27051,6 +27133,7 @@ exports[`GenerativeAiUseCases matches the snapshot 6`] = ` ], ], }, + "VITE_APP_AGENT_CORE_CODE_INTERPRETER_ENABLED": "false", "VITE_APP_AGENT_CORE_ENABLED": "true", "VITE_APP_AGENT_CORE_EXTERNAL_RUNTIMES": "[]", "VITE_APP_AGENT_CORE_GENERIC_RUNTIME": { diff --git a/packages/web/src/pages/AgentCorePage.tsx b/packages/web/src/pages/AgentCorePage.tsx index f1e9b8efe..1086f713b 100644 --- a/packages/web/src/pages/AgentCorePage.tsx +++ b/packages/web/src/pages/AgentCorePage.tsx @@ -43,6 +43,9 @@ const fileLimit: FileLimit = { maxVideoFileSizeMB: 0, }; +const agentCoreCodeInterpreterEnabled = + import.meta.env.VITE_APP_AGENT_CORE_CODE_INTERPRETER_ENABLED === 'true'; + // State management with zustand type StateType = { content: string; @@ -165,7 +168,12 @@ const AgentCorePage: React.FC = () => { sessionId, content, 'DEFAULT', - filesToSend + filesToSend, + undefined, // userId + undefined, // mcpServers + undefined, // agentId + undefined, // modelId + agentCoreCodeInterpreterEnabled ); setContent(''); clearFiles();