Commit 900418d
committed
fix(chat): rebuild the model messages after a steering injection
The UI and model accumulators are maintained separately, and a drained
message was appended to the UI one only. The model saw it through the
prepareStep return value, which is per-step, so the model lane never
learned it existed and every later turn of the run answered without it
while the browser, the snapshot and chat.history.* all still showed it.
The drain now marks the model lane stale and it is rebuilt from the UI
lane at the end of the turn. Flips the it.fails repro in
steering-injection.test.ts to a passing test.1 parent 692c060 commit 900418d
3 files changed
Lines changed: 40 additions & 11 deletions
File tree
- .changeset
- packages/trigger-sdk
- src/v3
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3561 | 3561 | | |
3562 | 3562 | | |
3563 | 3563 | | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
3564 | 3577 | | |
3565 | 3578 | | |
3566 | 3579 | | |
| |||
4286 | 4299 | | |
4287 | 4300 | | |
4288 | 4301 | | |
| 4302 | + | |
| 4303 | + | |
| 4304 | + | |
4289 | 4305 | | |
4290 | 4306 | | |
4291 | 4307 | | |
| |||
8600 | 8616 | | |
8601 | 8617 | | |
8602 | 8618 | | |
| 8619 | + | |
| 8620 | + | |
| 8621 | + | |
| 8622 | + | |
| 8623 | + | |
| 8624 | + | |
| 8625 | + | |
| 8626 | + | |
| 8627 | + | |
| 8628 | + | |
| 8629 | + | |
| 8630 | + | |
| 8631 | + | |
| 8632 | + | |
| 8633 | + | |
| 8634 | + | |
| 8635 | + | |
8603 | 8636 | | |
8604 | 8637 | | |
8605 | 8638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
367 | 363 | | |
368 | 364 | | |
369 | | - | |
| 365 | + | |
370 | 366 | | |
371 | 367 | | |
372 | 368 | | |
| |||
0 commit comments