Merged
Conversation
…formats Adds openadapt_types.parsing module with five public functions: - parse_action(): auto-detect format (DSL or JSON) and parse - parse_action_dsl(): parse DSL strings like CLICK(x=0.5, y=0.3) - parse_action_json(): parse JSON with canonical, flat, and coordinate formats - from_benchmark_action(): convert BenchmarkAction-style dicts to Action - to_benchmark_action_dict(): convert Action back to BenchmarkAction dict Handles Thought:/Action: prefixes, markdown fences, coordinate normalization detection, clamping, and legacy field mapping. All edge cases return Action(type=DONE) with a logged warning instead of raising. Includes 66 tests covering DSL, JSON, auto-detect, and BenchmarkAction round-trip conversion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
openadapt_types.parsingmodule with five public functions that convert DSL strings, JSON strings, and BenchmarkAction-style dicts into the canonicalActionmodelAction(type=ActionType.DONE)with a logged warning -- never raisesTest plan
tests/test_parsing.pycovering DSL, JSON, auto-detect, and BenchmarkAction round-trip🤖 Generated with Claude Code