Commit fef74f4
committed
fix(references): persist chat.history mutations in aiChatHydrated.onAction
The hydrate-mode task uses `hydrateMessages` to read the full message
chain from Postgres on every turn, so any `chat.history.*` mutation
inside `onAction` (undo / rollback / remove / replace) was lost the
moment the next turn started — the in-memory accumulator was
overwritten by a fresh DB read.
Write the mutated chain through with `prisma.chat.update` at the end
of `onAction` so next turn's hydrate sees the pruned/edited state.1 parent 42f8d64 commit fef74f4
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
915 | 927 | | |
916 | 928 | | |
917 | 929 | | |
| |||
0 commit comments