Repository navigation
Conversation
parse_action decoded a non-object reply as JSON before wrapping it in the single required field, so a reply like 12345, true, null or 1.5 for a field declared "type": "string" was sent as a number, bool or null, and OpenEnv rejected the step. For a string field it now sends the reply text as written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
parse_action(verifiers/v1/tasksets/openenv/taskset.py) says it takes "JSON, fenced JSON, or — for a single-required-field schema such as Wordle's — the raw field value". For a non-object reply, it runsjson.loadsfirst and wraps the result in the required field. When that field is a string, as TextArena'smessage: stris, a reply that happens to be valid JSON is sent with the wrong type. OpenEnv validates the action before stepping, so the step is rejected withServer error: Invalid message (code: VALIDATION_ERROR)and the rollout errors.Minimal repro on
main:End to end against a local OpenEnv 0.4.1 server:
GuessTheNumber-v0is rejected onmain. On this branch it is accepted and wins with reward 1.0.code: straction, the bare reply12345errors, while{"code": "12345"}scores 1.0.Fix
parse_action, when the single required field is a plain string (its schema has"type": "string"and only descriptive keys:title,description,default,examples) and the decoded reply is not astr, the fence-stripped reply text is sent instead.7;{"value": true});format,pattern, length limits,enum, ...), where a decoded number can be the valid input:timedeltaaccepts42, and acoerce_numbers_to_strfield with a pattern accepts1e2as"100.0".tests/unit/tasksets/test_openenv.py(mirroringverifiers/v1/tasksets/openenv/) holds one parametrized test ofparse_action. It needs neither theopenenvextra nor network.Not changed, and the same as on
main:anyOf, a type list or$ref(Optional[str], string enums);A constraint the schema doesn't show can still reject the raw text. Example: a model-level
str_max_lengthwithcoerce_numbers_to_str, wheremainsent1e+002as100.0and the server coerced it to"100.0". Sending{"field": ...}as an object always takes the decoded value.One behaviour change beyond the fix: for MCP envs,
CallToolActionhas one required string field,tool_name. So a bare reply like123now reaches the env as an unknown tool, where before it failed validation.Verification
test_parse_action: the four plain-string cases fail onmain({'message': [7]} != {'message': '[7]'}, …) and pass here. The seven unchanged-behaviour cases pass on both.uv run pytest tests/unit -n auto(Python 3.13): 513 passed, 10 skipped (main: 502 passed, 10 skipped).uv run ruff check,uv run ruff format --checkanduv run --python 3.13 ty check verifiersare clean.PRIME_API_KEY).I used an AI coding assistant (Claude Code) to find, fix and test this, including the local OpenEnv server runs; the checks above were run on my machine.
🤖 Generated with Claude Code
Note
Fix
parse_actionto keep raw reply text for unconstrained string fieldsparse_actionin taskset.py, when the action schema has exactly one required field and that field is a plain string schema (onlytype,title,description,default,exampleskeys), a JSON-decodable non-string reply is now returned as its stripped text instead of the decoded JSON value"123"for an unconstrained string field now produce{"message": "123"}instead of{"message": 123}; other schema shapes and parsed values are unchangedMacroscope summarized b182689.