fix: move suggested steps after notes - #867
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e8b2d0b80
ℹ️ 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".
| let terminal_complete_block_start = blocks | ||
| .iter() | ||
| .rev() | ||
| .find(|block| text[block.end..].trim().is_empty()) | ||
| .map(|block| block.start); |
There was a problem hiding this comment.
Handle trailing prose after the metadata block
When the assistant emits a valid suggested-next-steps block after the note but then appends any non-whitespace, this EOF-only check no longer classifies the block as metadata. In that scenario extract_note_content saves the fenced metadata and trailing prose into the note body, and extract_suggested_next_steps also skips the after-note block because it uses the same terminal-only rule, so suggestions can be lost or pulled from an older message. This is easy to hit when a provider adds a closing sentence despite the prompt; consider treating the last post-separator suggested-next-steps block as metadata even if stray prose follows it.
Useful? React with 👍 / 👎.
360c760 to
9280a32
Compare
9280a32 to
4aa9b68
Compare
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
Migration 0020 alters notes and project_notes, and 0025 adds their suggested_next_steps columns, so every partial fixture database that skips the baseline migration has to create both tables to migrate to head. Real databases at those versions have them from the baseline migration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
The sanitize/legacy-fallback/non-empty-prompt helpers were duplicated between store/models.rs and session_runner.rs, so the 4-item cap and trim rules had to be kept in sync by hand. Make the models.rs versions pub and use them from session_runner. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
4aa9b68 to
cec94d1
Compare
Summary
Tests