newestAssistantUnverified reports whether the turn's final assistant message already carries an "unverified" marker, the honest self-assessment the finish nudge exists to elicit. Case-insensitive: the model writes "unverified" / "Unverified" interchangeably. Used to suppress the finish nudge on a fi
(history []chmctx.Message)
| 1008 | return m, nil |
| 1009 | } |
| 1010 | q := m.queued |
| 1011 | m.queued = nil |
| 1012 | return m.submit(q.send, q.echo, promptEntry{display: q.send}) |
| 1013 | } |
| 1014 | |
| 1015 | // newestAssistant returns the newest assistant-role message in history: the |
| 1016 | // turn's final reply, which all three finish checks below inspect. |
| 1017 | func newestAssistant(history []chmctx.Message) (chmctx.Message, bool) { |
| 1018 | for i := len(history) - 1; i >= 0; i-- { |
| 1019 | if history[i].Role == chmctx.RoleAssistant { |
| 1020 | return history[i], true |
| 1021 | } |