diff --git a/backend/researcher/deploy.py b/backend/researcher/deploy.py index 5be0561a..99c48792 100644 --- a/backend/researcher/deploy.py +++ b/backend/researcher/deploy.py @@ -177,13 +177,19 @@ def main(): remote_image = f"{ecr_url}:{image_tag}" # Build Docker image + # Use buildx with provenance/sbom disabled so Lambda accepts the image. + # Modern Docker Desktop (BuildKit) adds attestation manifests by default, + # which AWS Lambda rejects with "image manifest, config or layer media type is not supported". print(f"\nBuilding Docker image for linux/amd64 with tag: {image_tag}") run_command( [ "docker", + "buildx", "build", "--platform", "linux/amd64", + "--provenance=false", + "--sbom=false", "-t", local_image, ".", diff --git a/backend/researcher/server.py b/backend/researcher/server.py index d87d62bd..d4e5fcd8 100644 --- a/backend/researcher/server.py +++ b/backend/researcher/server.py @@ -10,7 +10,7 @@ from fastapi import FastAPI, HTTPException from pydantic import BaseModel from dotenv import load_dotenv -from agents import Agent, RunHooks, Runner, trace +from agents import Agent, ModelSettings, RunHooks, Runner, trace from agents.extensions.models.litellm_model import LitellmModel # Suppress LiteLLM warnings about optional dependencies @@ -84,7 +84,7 @@ async def run_research_agent(topic: str = None) -> str: os.environ["AWS_REGION"] = region os.environ["AWS_DEFAULT_REGION"] = region model_name = os.environ.get( - "RESEARCHER_MODEL", "bedrock/global.openai.gpt-oss-120b-1:0" + "RESEARCHER_MODEL", "bedrock/us.amazon.nova-2-lite-v1:0" ) model = LitellmModel(model=model_name) @@ -109,6 +109,11 @@ async def run_research_agent(topic: str = None) -> str: model=model, tools=[ingest_financial_document], mcp_servers=[playwright_mcp], + # LiteLLM's Bedrock integration rejects the `tools` param by default. + # Explicitly allow it so the agent can use tools (function + MCP). + model_settings=ModelSettings( + extra_args={"allowed_openai_params": ["tools"]} + ), ) try: @@ -207,7 +212,7 @@ async def health(): "timestamp": datetime.now(UTC).isoformat(), "debug_container": container_indicators, "aws_region": os.environ.get("AWS_DEFAULT_REGION", "not set"), - "bedrock_model": "bedrock/amazon.nova-pro-v1:0", + "bedrock_model": "bedrock/amazon.nova-2-lite-v1:0", "mcp_logging_enabled": MCP_LOGGING_ENABLED, }