[Bug]: Chat threads can open or finish above the latest message #5903
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/web
Steps to reproduce#
- Open an existing thread with enough history to overflow the viewport.
- Scroll upward in one thread, then switch to another long existing thread.
- Alternatively, remain near the bottom while an agent produces a long response containing markdown, tool output, images, or other content whose height changes after rendering.
- Observe the timeline after hydration or the response finishes.
- Repeat the thread switch if necessary; the behavior is timing-dependent.
Expected behavior#
Opening or switching to a thread should settle at its latest content.
While the reader is near the bottom, new agent content should continue following naturally. Intentionally scrolling upward should preserve the reading position, and returning to the bottom should restore follow behavior.
Actual behavior#
The viewport can remain above the newest message after opening a thread or after a large response finishes rendering. The user must manually scroll down or use “Scroll to end” to continue the conversation.
Impact#
Major degradation or frequent failure
Version or commit#
main @ 02f4ce566
Environment#
T3 Code web client on Windows. The behavior is provider-independent and affects the shared web timeline used by web and desktop.
Logs or stack traces#
No associated exception or console error.
Screenshots, recordings, or supporting files#
- Before: attach screenshot showing the viewport stranded above the latest response.
- Reproduction: attach a short recording of opening a long thread or completing a long response.
Workaround#
Manually scroll to the bottom or use the “Scroll to end” button.
Additional repro detail for the thread-switch variant (desktop/web timeline):
- Send a prompt in thread A, switch to thread B while A's turn runs, return to A after the response lands.
- The viewport is stranded above the newest message — often farther up than where it was left.
- The "Scroll to end" pill does not appear until you nudge the scroll up/down a little, suggesting the end-state tracking believes it is already at the end when it is not (END key works as a manual recovery).
Suspected mechanism from reading the code (not runtime-verified): the cached position for A was saved with
atEnd: truewhen leaving (timelineScrollAnchoring.ts), so the return path takesscrollToEndand hides the pill (ChatView.tsxthread-switch effect). TransientisAtEnd=falseevents during settling are suppressed by the post-open live-follow guard (onIsAtEndChangeearly return) plus the show-debounce. If row heights settle afterward (streamed markdown/tool output measuring late), the viewport strands withisAtEndRefstale-true and no further scroll event to correct it; a manual wheel bumps the scroll generation viacancelTimelineLiveFollowForUserNavigation, letting the nextisAtEnd=falsethrough so the pill appears.Filing the stale-pill half as a separate follow-up issue and linking it here.
Follow-up filed as #12372 (stale scroll-to-end pill / end-state after thread-switch stranding).
Same here on the desktop app.
Opening an existing thread sometimes lands at the top, or somewhere in the middle, instead of on the latest message. I start reading and only notice later that it is not the current end of the thread. It feels like a stored scroll position that sits much further up than where I left off. It only happens sometimes.
Machine, roughly:
- T3 Code desktop 0.0.42 (AppImage)
- Pop!_OS 24.04 LTS, kernel 7.1.5, x86_64
- COSMIC on Wayland
Created with AI · Commissioned by Karsten.
Note
Grok responding on behalf of Julius.
Fixed by #19663, which just merged: long threads now open at the newest message instead of stopping above it, while saved reading positions are still restored. The stale scroll-to-end pill after a thread switch is tracked separately in #12372. If you still see the viewport settle above the end after a long response finishes rendering on the latest main, please open a new issue with the repro.
juliusmarminge closed this
Sign in to join this conversation.
Confirming this on macOS with the desktop app at 0.0.40, so it is not Windows specific and it has survived the releases since 02f4ce566.
The case I hit is step 2. Switching between existing threads whose history overflows the viewport regularly leaves the timeline partway up the conversation instead of at the latest message, and I scroll down by hand each time. It is intermittent in the way the report describes, which fits the timing dependent explanation rather than anything particular to a given thread.
No console errors, and the scroll to end button works as a workaround.