bf85781ffb
LLM responses can include bracketed prose before the actual JSON array. The old greedy regex spanned from the first '[' to the last ']', causing valid single-array answers to be dropped and making multiple arrays indistinguishable. Constraint: Keep object extraction behavior unchanged. Rejected: Return first parseable array | silently guesses when a response has multiple valid arrays. Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep array extraction conservative when more than one valid top-level array is present. Tested: uv run --with pytest pytest tests/test_json_utils.py -q Tested: uv run --with ruff ruff check skillopt/utils/json_utils.py tests/test_json_utils.py Not-tested: Full benchmark rollouts.