Skip to content

fix(web): New lead chat opens the new lead instead of sending you home - #986

Merged
badcuban merged 1 commit into
mainfrom
fix/new-lead-chat-opens
Nov 18, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/new-lead-chat-opens

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

"New lead chat" (from the project menu or the command palette) made the lead and then landed you back on the home screen. A live check on main found it.

The cause: it opened the new thread before this app had heard of it, and the thread page sends you home for a thread it doesn't know. Now it opens the lead once the thread has arrived. It uses one shared wait (waitForAppState in store.ts), which replaces the two near-copies that already waited for something the server made: a set-up project and a started thread. If the thread hasn't arrived after 10 seconds, it says the lead was started instead of opening it into the same bounce.

Two smaller things from the same check:

  • On an install with no default agent chosen, it refused ("Pick a default agent for new threads in Settings first"), although a new thread there works. It now picks the same agent a fresh draft's composer does (fallbackNewThreadModelSelection). It also stops using the project's old stored model pin, which new threads ignore.
  • The project list stayed open after choosing the lead item. It now closes.

Checks: fmt, lint and typecheck pass. The web unit tests pass (256 files), and so does the full browser suite (111 files, 1,101 tests). Two new browser tests (with and without a default agent) check after every frame that the page lands on the new lead and stays there; both fail without the fix. New unit tests cover the fallback while agents are loading, with Codex off, and with a custom Codex account listed first.

New lead chat made the lead and opened it before this app had heard of the
thread, so the thread page found no thread there and went home. It now
opens it once the thread has arrived (waitForAppState, now shared with the
two places that already waited for something the server made: a set-up
project and a started thread). If it hasn't arrived in 10 seconds it says
the lead was started instead of opening it into the same bounce.

On an install with no default agent chosen it refused, although a new
thread there runs on the composer's own fallback. It now takes the same
agent a new thread would (fallbackNewThreadModelSelection: the composer's
entry order, Codex first, its offline fallback while agents load), and no
longer the project's stored model pin, which new threads ignore. The
project list closes when its lead item is chosen. Also drops an unused
import in leadChat.ts.
@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 18, 2026 3:10am UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit d5df7d3 Nov 18, 2026
24 checks passed
@badcuban
badcuban deleted the fix/new-lead-chat-opens branch November 18, 2026 03:26

This branch was previously deployed

1 inactive deployment
Preview — a1dca45b Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant