Skip to content

修正 OpenAPI 固定请求头日志与异步测试#122

Closed
117503445 wants to merge 1 commit into
Serverless-Devs:mainfrom
117503445:fix-openapi-review-feedback
Closed

修正 OpenAPI 固定请求头日志与异步测试#122
117503445 wants to merge 1 commit into
Serverless-Devs:mainfrom
117503445:fix-openapi-review-feedback

Conversation

@117503445

Copy link
Copy Markdown
Contributor

改动说明

补充修复 #119 合入后遗留的 review feedback:

  • call_tool / call_tool_async 的 debug 日志改为打印实际发送的 request_arguments
  • 避免过滤前 arguments 中的 fixed-header-like 参数进入日志。
  • 新增 fixed header async 测试中将 __aexit__ 设为 AsyncMock(return_value=False),避免 context manager mock 吞异常。

验证

  • uv run pytest tests/unittests/tool/test_openapi.py -q
  • uv run pyink --check --config pyproject.toml agentrun/tool/api/openapi.py tests/unittests/tool/test_openapi.py
  • uv run isort --check-only agentrun/tool/api/openapi.py tests/unittests/tool/test_openapi.py
  • git diff --check -- agentrun/tool/api/openapi.py tests/unittests/tool/test_openapi.py

关联

用户要求:处理 PR Serverless-Devs#119 中关于固定请求头日志和 async 测试 mock 的 review 意见。

实现思路:
- debug 日志改为打印实际发送的 request_arguments
- 避免过滤前 arguments 中的 header-like 参数进入日志
- 新增 fixed header async 测试的 __aexit__ 显式返回 False,避免吞异常

Signed-off-by: 黑曜 <haotian.qht@alibaba-inc.com>
@117503445 117503445 closed this Jun 17, 2026
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.

1 participant