6 Commits
Author SHA1 Message Date
d769acf43f fix(sessions): paginate tool-heavy session tails by visible messages (#4069) (#4215)
* fix: bound paginated session tails by visible messages

* fix(#4070): always merge state.db tail rows (drop the stale-tail timestamp shortcut)

Deep-review finding: the sidecar-only timestamp shortcut returned the sidecar
verbatim whenever state.db had no strictly-newer rows, but a state.db row
at-or-before the sidecar's newest timestamp (recovery / edited-in-place /
missing-timestamp) is still absent from the sidecar -> the paginated tail
diverged from the full merge path (empirically 3/6 adversarial cases). Always
run the cheap in-memory append-only merge; the real latency win (skipping the
lineage-parent DISK load) is preserved.

Co-authored-by: t3chn0pr13st <t3chn0pr13st@users.noreply.github.com>

* fix(#4070): keep matching trailing tool-result row in paginated window

Codex ship-gate finding: _message_window_for_display pulled end_idx back to the
last renderable (user/assistant) row, dropping a trailing role:tool result row
even when it's the result of the newest assistant tool-call. The renderer
rebuilds tool cards from these rows (CLI-origin / empty S.toolCalls path,
static/ui.js resultsByTid), so the card lost its result snippet. Now extend
end_idx forward through trailing tool rows whose tool_call_id matches a tool-call
present in the window; orphan trailing tool rows (no match) are still skipped to
preserve the visible-row budget. +2 regression tests.

Co-authored-by: t3chn0pr13st <t3chn0pr13st@users.noreply.github.com>

* chore(#4070): remove now-dead _max_message_timestamp + its import

Opus gate nit: _max_message_timestamp was only called by the removed
sidecar-timestamp shortcut, and the _message_timestamp_as_float import existed
solely to feed it. Both removed; _message_timestamp_as_float still lives in
api/models.py for its real callers.

* chore: add #4069 CHANGELOG entry (visible-message tail pagination)

* chore(release): stamp v0.51.424 (Release OK) for #4069

---------

Co-authored-by: t3chn0pr13st <technopriest@live.ru>
Co-authored-by: nesquena-hermes <agent@nesquena-hermes>
Co-authored-by: t3chn0pr13st <t3chn0pr13st@users.noreply.github.com>
2026-06-14 19:18:11 -07:00
b5caf83ff9 Release v0.51.279 — Release IU (stage-p3h — preserve Activity/streaming turn on mid-stream scroll #3665) (#3686)
* fix(streaming): preserve Activity + streaming turn when loading earlier messages mid-stream (#3665, #3346)

Co-authored-by: mysoul12138 <839465496@qq.com>

* docs(changelog): v0.51.279 — Release IU (stage-p3h)

---------

Co-authored-by: nesquena-hermes <[email protected]>
Co-authored-by: mysoul12138 <839465496@qq.com>
2026-06-05 14:45:31 -07:00
ai-ag2026 b891e4fe77 fix: avoid double rebasing legacy tool cards 2026-05-30 16:10:52 +02:00
ai-ag2026 d57854807a fix: keep tool cards anchored during history paging 2026-05-30 14:57:00 +02:00
MinhoJJang d920d4222a Trim paginated session tool call payloads 2026-05-25 18:28:43 +09:00
Frank Song b7ac5a8b88 Trim session tail response overhead 2026-05-13 15:57:29 +08:00