Suppress "WARNING: Invalid HTTP request received." warning

未關閉
#225 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
python
領域
backend

研究方向

從執行階段啟動路徑開始,使用 01-tutorials/01-AgentCore-runtime/01-hosting-agent/01-strands-with-bedrock-model/runtime_with_strands_and_bedrock_models.ipynb 中的 lifespan 範例重現此警告。追蹤 "WARNING: Invalid HTTP request received." 的發出位置,並驗證初始化不再記錄這則無害訊息,同時應用程式記錄不受影響。

由索引模型根據 Issue 內容生成。

描述

The following log may be recorded in the Application log output to CloudWatch Logs when the AgentCore runtime starts up.
When recorded during initialization after deployment, this is a message that does not affect the application. However, this could confuse users, so I would like to suppress it.

For example, you can confirm this log message by adding a lifespan to strands_claude.py as follows:

from contextlib import asynccontextmanager
from typing import AsyncGenerator

from strands import Agent, tool
from strands_tools import calculator # Import the calculator tool
import argparse
import json
from bedrock_agentcore.runtime import BedrockAgentCoreApp
from strands.models import BedrockModel

@asynccontextmanager
async def lifespan(_app: BedrockAgentCoreApp) -> AsyncGenerator[None, None]:
    """Completely empty lifespan context manager for testing."""
    yield
app = BedrockAgentCoreApp(lifespan=lifespan)

# Create a custom tool 
@tool
def weather():
    """ Get weather """ # Dummy implementation
    return "sunny"
(snip)
主要語言
Python
星號
786
分支
163
平均合併
4 小時
30 天內合併 PR
22

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

aws/bedrock-agentcore-sdk-python 的其他 Issue

查看 aws/bedrock-agentcore-sdk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。