pub fn parse_json_from_opencode_text<T: DeserializeOwned>(
text: &str,
) -> Result<T, String>Expand description
Parse a JSON value from opencode output text.
Opencode has no --output-schema, so the LLM may include markdown
fences or explanation text around the JSON. This function tries:
- Direct JSON parse of the full text
- Extract JSON from markdown code fences
- Find the first
{to last}substring