Commit 9c2b97c
Fix chat titles empty when conversation has thinking blocks (Anthropic)
When re-generating the title at the 3rd user message, the full
conversation history was passed as past-messages. For thinking models
(e.g. nubank-anthropic/opus-4.6), this history includes "reason" role
messages. normalize-messages converts them to {:type "thinking" ...}
content blocks, but title generation disables thinking (reason? false),
so the request carries thinking blocks without the :thinking parameter.
The Anthropic API responds with {:text ""}, which is truthy in Clojure,
so sanitize-title returns "" and overwrites any previously good title.
Fix: filter "reason" role messages out of title-past-messages before
the sync prompt call.
🤖 Generated with [eca](https://eca.dev)
Co-Authored-By: eca-agent <git@eca.dev>1 parent 4359d05 commit 9c2b97c
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
| 579 | + | |
579 | 580 | | |
580 | 581 | | |
581 | 582 | | |
| |||
0 commit comments