[Bug]: A new thread that only runs a project script never appears in the sidebar, so it's lost once you navigate away#25194

opened9d agobyKkalibismail

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

  1. Open a project that has a project script (I used a test action with the command echo started; sleep 300; echo finished).
  2. Start a new thread in that project (sidebar New thread → pick the project). The URL is /draft/<id>.
  3. Without typing anything in the composer, run the script from the thread details panel.
  4. The terminal drawer opens and the script starts (started is printed).
  5. Click any other thread in the sidebar.

Expected behavior

The new thread stays reachable from the sidebar while its script terminal exists, so I can go back to check the output or stop the script.

Actual behavior

The new thread never gets a sidebar row, not even during step 4 while it's the active thread. After navigating away there's nothing in the sidebar for it (I also checked the expanded Snoozed and Settled sections), so there's no way back to it through the UI.

The thread and its script still exist:

  • The script process keeps running after I navigate away (sleep 300 was still alive).
  • The draft is still in localStorage (t3code:composer-drafts:v1).
  • The browser Back button returns to /draft/<id> with the terminal still showing the running script.

So the script ends up running with no visible thread to see its output or stop it.

Impact

Minor bug or occasional failure

Version or commit

main @ 0b42aa94 (also seen on the 0.0.46-nightly.20261013 desktop/server build in daily use). The relevant files are unchanged on main @ 888a3d47.

Environment

Linux (kernel 7.0.0-31-generic), web client in Chromium against vp run dev. No provider involved: nothing is sent.

Logs or stack traces

No related errors in the browser console.

Screenshots, recordings, or supporting files

  1. Script running in the new, unsent thread: the sidebar has no row for it.
  2. After clicking another thread: still no row anywhere for it.
  3. Browser Back: the thread is still there and its script is still running.
  4. Recording of the full repro.

Workaround

Use the browser Back button to return to the thread.

Suspected cause (not confirmed)

SidebarDraftBlock only lists a draft when composerDraftHasUserContent(composer) is true (apps/web/src/components/sidebar/SidebarDraftBlock.tsx, around lines 161 and 186). That check looks only at composer content (prompt, images, files, contexts and so on), so a draft whose only content is a script terminal is filtered out. This might be related to the draft-in-sidebar work in #5534. I haven't tested a fix.