Fix Gradio Playground MCP argument parsing - #1081
Conversation
There was a problem hiding this comment.
Stale comment
Reviewed at
9b765f8e2e1dbf2319db74395a4cc94552964c2b: JSON-dict preprocessing fixes the MCP Playground form while preserving strict validation for malformed, list, and scalar inputs; the regression coverage is appropriate and no alignment issue was found. Before merge, refresh onto currentmain, approve the first-contributor workflow run, and require green exact-head CI. The required workflows are currentlyaction_requiredand never executed.Sent by Cursor Automation: Release
There was a problem hiding this comment.
Stale comment
Refresh review vs main
b12450f2(Ben ask):Verdict: LGTM after rebase. Exact head
9b765f8eis ~66 behind main. Preprocessing-only JSON parse of Gradio stringargumentsforcall_toolis correct; strictdeserialize_actionstill rejects strings; tests cover dict/valid JSON/malformed/array/scalar and non-mutation. AGENTS.md gotcha removal matches the fix. Please rebase + refresh CI (Approve-and-run if needed), then squash-merge.Sent by Cursor Automation: Release
There was a problem hiding this comment.
Refresh review (Wed 2026-09-16)
Still BEHIND main (9b765f8e), but content is still correct: JSON-decode string arguments for Gradio call_tool in deserialize_action_with_preprocessing, with focused tests.
No conflict with #1169. This exact change is already included in #1172 (cdcd41a5). Prefer landing via #1172 (after #1172 drops the unrelated #1000 commit); then close this PR as superseded.
If #1172 is split differently, an on-repo replacement of these four files onto current main is fine.
Sent by Cursor Automation: Release


Fixes #1080.
Summary
argumentsfor MCPcall_toolactions at the web preprocessing boundary./web/steppath.AGENTS.md.Tests
PYTHONPATH=src:envs uv run pytest tests/core/ -qPYTHONPATH=src:envs uv run pytest tests/ -quv run usort check src/openenv/core/env_server/serialization.py tests/core/test_mcp/test_mcp_types.py tests/core/test_web_interface_mcp.pyuv run ruff format src/openenv/core/env_server/serialization.py tests/core/test_mcp/test_mcp_types.py tests/core/test_web_interface_mcp.py --checkuv run ruff check src/openenv/core/env_server/serialization.py tests/core/test_mcp/test_mcp_types.py tests/core/test_web_interface_mcp.pyFull suite:
1641 passed, 129 skipped.Note
Low Risk
Scoped to the web preprocessing deserialization path with clear validation boundaries and broad test coverage; no auth or data-model changes.
Overview
Fixes Gradio Playground and
POST /web/stepfailures when MCPcall_toolactions sendargumentsas a JSON string (textbox) instead of an object.deserialize_action_with_preprocessingnow JSON-decodes stringargumentsfortype: call_toolinto a dict on a copy of the payload (input is not mutated).deserialize_actionstays strict—stringargumentsstill fail validation. Malformed JSON, arrays, and scalar JSON strings still raiseValidationError.Regression tests cover serialization edge cases and an integration test on
/web/step.AGENTS.mddrops the old workaround note about the broken Playground Step form.Reviewed by Cursor Bugbot for commit 9b765f8. Bugbot is set up for automated code reviews on this repo. Configure here.