openai / openai/codex

Incorrect scroll position when app is backgrounded before the first response token

Open
#45,183 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.908.40834

What subscription do you have?

pro

What platform is your computer?

Windows 11 x64

What issue are you seeing?

The desktop app restores an incorrect conversation scroll position when I send a prompt and switch to another application before the first assistant token is rendered.

If I immediately Alt+Tab away after sending a message, wait for the response to finish in the background, and then return to the app, the conversation is often positioned near the end of the newly completed assistant response.

In the most obvious cases:

  • The last part of the assistant response appears near the top of the window.
  • A very large blank area appears below the response.
  • The scrollbar is already at or very close to the bottom.
  • I have to manually scroll upward to find the beginning of the response before I can start reading it.

This does not appear to depend on response length. I reproduced it with both shorter and relatively long responses.

The important observation is that the behavior changes depending on whether the first assistant token has already appeared.

If I wait until at least the first token is rendered and only then switch to another application, the scroll position after returning is much more normal.

So there appears to be a reproducible difference between:

  1. Backgrounding the app before the first response token is rendered.
  2. Backgrounding the app after streaming has already started.
What steps can reproduce the bug?
  1. Open a conversation in the Windows desktop app.
  2. Send a prompt that takes at least a few seconds before the assistant starts responding.
  3. Immediately switch to another application with Alt+Tab, before any assistant text/token is rendered.
  4. Leave the app in the background and wait for the response to finish.
  5. Return to the desktop app.
  6. Observe the conversation scroll position.

Actual result:
The viewport is often positioned near the end of the newly completed response, sometimes with the last few paragraphs near the top of the screen and a very large blank area below them.

Control test:

  1. Send another prompt.
  2. Wait until the first assistant token/text becomes visible.
  3. Then Alt+Tab to another application.
  4. Wait for the response to finish.
  5. Return to the app.

In this case, the resulting scroll position is noticeably more normal.

I have been able to reproduce this difference repeatedly.

What is the expected behavior?

The conversation viewport should behave consistently regardless of whether the app is backgrounded before or after the first assistant token is rendered.

When returning to the app after a response has completed in the background, the completed response should be presented at a sensible reading position and should not appear near the top of the viewport with a large empty area below it.

For a response that completed while the app was in the background, it would ideally also be easy to start reading the unread response from its beginning.

Additional information

This seems specifically related to backgrounding the app before response streaming begins.

The issue is much easier to reproduce when I:

Send prompt -> immediately Alt+Tab before first token -> wait for completion -> return

than when I:

Send prompt -> wait for first token -> Alt+Tab -> wait for completion -> return

I am attaching screenshots showing the difference.

Screenshot 1:
App was backgrounded before the first response token. After returning, the response ends near the top of the viewport and a very large blank area is visible below it.
Image
Screenshot 2:
App was backgrounded only after the first response token had appeared. The resulting viewport/scroll position is much more normal.

Image

This workflow is common for me because model responses can take some time to generate, so I normally send a request, switch to another application while it is working, and return after the response has finished.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows desktop workflow: send a prompt, switch away before the first assistant token, wait for completion, and return to the app; compare it with switching away after streaming begins. Trace the conversation viewport and response-streaming entry points to identify where scroll position is restored, then verify that both timing cases produce a sensible reading position without excess blank space.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.