fix: parse inline suggested-next-steps fences#787
Conversation
Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 084e3967d0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if after_marker | ||
| .find('\n') | ||
| .is_some_and(|newline| after_marker[..newline].trim().is_empty()) | ||
| { | ||
| return Some(abs); |
There was a problem hiding this comment.
Keep prose mentions from shadowing the real steps block
When an assistant message mentions the marker inline before the actual block (for example a sentence or code sample ending with ````suggested-next-stepsfollowed by a newline), this now returns that mention as the opening fence because it only validates the text after the marker.extract_suggested_next_steps` then tries to parse everything until the next closing fence and returns `None` on malformed JSON, so it never reaches a later valid `suggested-next-steps` block in the same message and the note loses its suggested next actions. Consider either continuing after parse failures or adding a preceding-character/fence-boundary check that still permits the intended `sentence.```suggested-next-steps` case.
Useful? React with 👍 / 👎.
Summary