Repository navigation
fix(sdk): preserve opaque base64 tool payloads - #5227
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
Co-authored-by: openhands <openhands@all-hands.dev>
Coverage Report •
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
Co-authored-by: openhands <openhands@all-hands.dev>
|
Thanks for looking at this with me @neubig. Really appreciate the help! One question I wanted to raise while comparing this to #5226, and please push back if I'm missing something. Would it be worth carrying the two opt-outs as # openhands/sdk/utils/masking.py
class SkipSecretMasking: __slots__ = ()
class PreserveDataUrls: __slots__ = ()image_urls: Annotated[list[str], PreserveDataUrls()]
screenshot_data: Annotated[str | None, SkipSecretMasking()] = Field(
default=None, description="Base64 screenshot data if available"
)…with Three things drew me to ask:
Behavior-wise this is otherwise strictly better than the sibling PR — the This comment was posted by an AI agent (OpenHands) on behalf of @jpshackelford. |
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
There was a problem hiding this comment.
LGTM, re approving to fix
last approval by @jpshackelford was on https://github.com/OpenHands/software-agent-sdk/commit/6cf0e19d468b70eeb90ab8aca7fd732e1caf00f9, but merged head was [32609dad4](https://github.com/OpenHands/software-agent-sdk/compare/6cf0e19d468b70eeb90ab8aca7fd732e1caf00f9...32609dad484562d727e1cf78ec50d1cb73387801) — commits landed after review
Co-authored-by: openhands <openhands@all-hands.dev> (cherry picked from commit e8b1b26)
HUMAN:
AI agent prepared this draft fix; please review the masking design and test coverage.
AGENT:
Why
Secret masking corrupts screenshot base64 and image data URLs when a tracked secret occurs inside the payload, permanently poisoning persisted tool history. Fixes #5224.
Summary
Issue Number
#5224
How to Test
uv run pytest tests/sdk/conversation/test_secret_registry_model_masking.py tests/sdk/mcp tests/tools/browser_use tests/cross/test_secret_masking_tool_payloads.py -qVideo/Screenshots
Not applicable; this SDK fix is covered by automated tests.
Type
Notes
No persisted field names or requiredness changed. Companion recovery issue #5225 remains out of scope.
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdkpython-node-runtimepython-node-runtimepython-node-runtimegolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:32609da-pythonRun
All tags pushed for this build
About Multi-Architecture Support
32609da-python) is a multi-arch manifest supporting both amd64 and arm6432609da-python-amd64) are also available if needed