Skip to content

Studio: keep project chat runs alive across view switches - #9129

Merged
danielhanchen merged 51 commits into
unslothai:mainfrom
NilayYadav:fix-project-chat-detach
Aug 24, 2026
Merged

danielhanchen merged 51 commits into
unslothai:mainfrom
NilayYadav:fix-project-chat-detach

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

Fixes #8908. A chat started inside a project ran under ProjectLanding's own ChatRuntimeProvider; navigating to another chat mid-response unmounted it, aborting generation (the backend cancels on client disconnect), so the user returns to a truncated "Response stopped." while the identical navigation in a non-project chat lets the run finish, because the single-chat view already shares one provider across thread switches.

This hoists a single ChatRuntimeProvider above the project/single view switch (compare mode keeps its per-pane providers) and lifts the project's new-thread nonce to ChatPage so the shared provider and the project composer agree on it extending the app's existing keep-alive pattern rather than adding a new mechanism.

@pre-commit-ci
pre-commit-ci Bot requested a review from danielhanchen as a code owner August 17, 2026 21:57
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 6a73516333

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

Confirmed this hits chat-page.tsx where ProjectLanding mounts its own ChatRuntimeProvider, so leaving the project view mid-response aborts the run while the single chat view survives the same navigation. Will get this reviewed.

@mahiatlinux

Copy link
Copy Markdown
Contributor

A staged composer attachment follows you into the next project (studio/frontend/src/features/chat/chat-page.tsx:3668)

The hoisted provider carries no key, so RemoteThreadListRuntimeCore and the uninitialized new thread it holds survive every project and view switch. Entering a project landing or a ?new= chat resets the view only through ThreadNewChatSwitch (studio/frontend/src/features/chat/runtime-provider.tsx:1653), and switchToNewThread() reuses the existing newThreadId rather than minting one; switchToThread then early-returns because that id is already the main thread. newThreadId is cleared only when the thread is initialized, which happens on the first send. The composer holding the attachments belongs to that thread, so it is literally the same composer.

Open project A, attach a file to the "New chat in A" composer (studio/frontend/src/features/chat/chat-page.tsx:1532), do not send, then click project B in the sidebar (studio/frontend/src/components/app-sidebar.tsx:1853). Project B's landing composer still shows A's file, and sending there files it into a chat under project B. The same holds in both directions between a project landing and /chat?new=…. At the merge base the provider was keyed per project, so crossing that boundary constructed a fresh core and the composer was necessarily empty.

The asymmetry shows this is not intended: the same navigation does clear the typed text, because the remounted composer runs composer.setText("") (studio/frontend/src/components/assistant-ui/thread.tsx:2809), while clearAttachments has exactly one call site in the app, inside the prompt-queue send path (studio/frontend/src/components/assistant-ui/thread.tsx:3452). A file staged in a temporary chat is worse again: studio/frontend/src/features/chat/chat-page.tsx:2478 drops incognito when you land on a project, so the carried-over attachment gets persisted.

Fix: clear the outgoing composer in ThreadNewChatSwitch when the nonce actually changes. Keep the previous nonce in a ref first, since that effect also re-runs when isLoading flips and an unconditional clearAttachments() would wipe an attachment the user just staged on a live ?new= chat.

initialActiveThreadRef is now always null, so the guard at studio/frontend/src/features/chat/chat-page.tsx:1384 can never fire

ThreadNewChatSwitch is rendered as an earlier sibling of {children} (studio/frontend/src/features/chat/runtime-provider.tsx:2203 vs :2207), so its mount effect runs before ProjectLanding's. On a provider that is already mounted, threads.isLoading is false, so that effect no longer early-returns: it reaches setActiveThreadId(null) at studio/frontend/src/features/chat/runtime-provider.tsx:1654 before ProjectLanding reads the value at studio/frontend/src/features/chat/chat-page.tsx:1207.

At the merge base the project view built its own provider, whose core starts at isLoading: true and is only resolved by an effect on the provider itself, which React runs after its children. ThreadNewChatSwitch returned early on that first pass and initialActiveThreadRef captured the real outgoing thread id.

Concretely: project A landing, click chat T in the landing list, then browser Back to ?project=A. Every programmatic route into project mode blanks activeThreadId first, so Back and deep links are the only entries that arrive with it still set, and those are exactly the ones the ref existed for. With the ref pinned at null the comparison at :1384 is dead, and setPendingNewThreadId(activeThreadId) at :1399 is no longer held off for the outgoing chat, which is what swaps the landing for <Thread targetThreadId={T}/> at :1451.

Fix: capture the outgoing id before the provider's children can blank it, with a lazy useRef initializer or a useLayoutEffect instead of the passive effect at :1206. Or delete the guard, but do not leave it comparing against a value that is now always null.

Compare is the one view switch left that aborts the run, and it now aborts runs the user cannot see (studio/frontend/src/features/chat/chat-page.tsx:3667)

view.mode !== "compare" renders CompareContent in the provider's place, so entering compare unmounts the shared provider. useLocalRuntime's unmount cleanup calls detach(), which aborts the run's controller, and _await_disconnect_then_cancel (studio/backend/routes/inference.py:3090) sets cancel_event within 100 ms of the disconnect. The result is the same truncated "Response stopped." as #8908.

This predates the change, but the change is what makes it reachable with a run in the background. Start a chat in a project, navigate to an old chat so the run keeps streaming, which is the behaviour this PR adds, then open a compare chat: a compare row in the project's own grid navigates to {compare, project} (studio/frontend/src/features/chat/chat-page.tsx:1637), as does the sidebar (studio/frontend/src/components/app-sidebar.tsx:2508) and "Compare chat" in the composer menu (studio/frontend/src/components/assistant-ui/thread.tsx:5306). Nothing warns, and a run the user had every reason to think was safe dies. Before this PR that run was already dead, so nothing was lost.

Fix direction: render CompareContent as a sibling of the provider and hide the inactive branch with display:none plus inert, the way studio/frontend/src/app/routes/__root.tsx:404 already keeps the whole chat tab alive off-route. They have to be siblings, not nested, because ComparePane mounts its own ChatRuntimeProvider (studio/frontend/src/features/chat/chat-page.tsx:620) and useRemoteThreadListRuntime throws on nesting. The hidden base provider also needs ActiveThreadSync held off while compare is up, since enterCompare clears activeThreadId (studio/frontend/src/features/chat/chat-page.tsx:3059).

Nothing pins the invariant the fix rests on

The change replaces "keyed by project" with "never keyed at all", and re-adding either key silently restores #8908. No test in studio/frontend/tests/ or tests/studio/ references ChatRuntimeProvider, ProjectLanding or SingleContent, and this PR adds none, so the whole suite stays green with the production hunk reverted.

studio/frontend/tests/project-attachment-target-adoption.test.ts:240 already pins sibling invariants in this exact file by matching its source. The same idiom covers this one: exactly one <ChatRuntimeProvider outside ComparePane, rendered outside SingleContent and ProjectLanding, carrying no key=.

The reason for that invariant was deleted (studio/frontend/src/features/chat/chat-page.tsx:3665)

The merge base carried a six-line comment at this exact site explaining why the provider was keyed by project only and what remounting costs. Commit f7c1fca removes it along with the note that replaced it, leaving an unkeyed provider with nothing recording why it must stay that way. The rest of the file is dense with exactly this kind of why-comment.

key={view.projectId ?? "single"} on SingleContent is left over (studio/frontend/src/features/chat/chat-page.tsx:3691)

It existed to control the provider's identity, and the provider is no longer inside SingleContent. All that remounts under it now is artifact panel animation state (studio/frontend/src/features/chat/chat-page.tsx:329), and the artifactViewKey effect at studio/frontend/src/features/chat/chat-page.tsx:2500 already closes the surface on that transition. Drop it, or say what it is still for.

@mahiatlinux mahiatlinux self-assigned this Aug 19, 2026
@mahiatlinux
mahiatlinux self-requested a review August 19, 2026 09:46

@mahiatlinux mahiatlinux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review posted as a comment above.

@danielhanchen

Copy link
Copy Markdown
Member

Re-checked at this head: the composer no longer carries a staged attachment across a nonce change, and the outgoing thread id is now captured in render rather than an effect, so the Back-into-a-project guard actually fires. Looks right to me.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: c0df101bb4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 9498aef944

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

Before/after evidence for #8908

Two isolated Studio installs, one per side, each built from its own checkout with its own UNSLOTH_STUDIO_HOME, port, password and log:

  • BEFORE 38e4e11a1c02ae9e6300d6164dd102509b7859cc (this PR's merge base with main)
  • AFTER 9498aef944791db3792a08f80c6c4a38e770fffe (head)

Same scene on both sides, driven through the real UI: create a project, send from the project composer, then click another chat in the sidebar mid-response (an in-app row click, never a reload — a reload would abort the run on both sides and prove nothing), wait out the rest of the answer, and come back.

The answer is a fixed 40-token stream that ends the moment its request is aborted, the way the backend does when the client disconnects. That makes the abort a number rather than a judgement call: both sides left at exactly token 5.

before/after

BEFORE AFTER
tokens the answer has 40 40
tokens delivered when the user left 5 5
tokens delivered in total 5 40
run aborted by the navigation true false
run reached its last token false true
tokens visible in the returned chat 5 40
last token visible w05 w40
tokens persisted for the chat 5 40
"Response stopped." notice true false

BEFORE the chat comes back holding w01 … w05 under a "Response stopped." bar; AFTER the same navigation leaves the run attached and the chat holds the whole w01 … w40 answer.

Also in this round: rebased on current main (the merge conflict in chat-page.tsx was ChatModelNotice from #9081 landing next to the view switch this PR restructures — kept as a sibling of the shared provider, exactly where main has it), and bound the new paused prop in tests/studio/test_new_chat_context_recount.py, whose emulator replays ThreadNewChatSwitch's real effects and was failing Repo tests (CPU) with emulator does not bind ['paused']. That harness now also carries two behavioural tests that fail on the merge base and pass here: a paused switch opens no thread, blanks no active thread and prices nothing until the pause lifts, and a staged attachment is cleared only when the switch actually moves to another nonce.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

…ing was away

Retaining the chat across a view switch is what this PR added; at the merge base
leaving the project view unmounted the landing, so there was nothing to restore
and the question could not arise.

Nothing else clears the retained id. It is component state, so the sidebar's
global delete does not reach it, and compare does not hold the chat as the
store's active thread, so the reset inside deleteChatItems does not fire either.
A chat deleted while compare was on screen therefore came back on exit: the
landing rendered a conversation storage no longer has, with a composer pointed
at it.

Check the tombstone before restoring, and fall through to the existing rotate so
the landing is left with a fresh thread to send into rather than a dangling id.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Retaining a chat across a view switch added three places that put a retained id
back: ProjectLanding's resume effect, NonceThreadResumeRestore, and the
remembered-nonce reopen. All three ask the runtime whether it still knows the
thread. Studio deletes by tombstoning storage rather than calling
runtime.threads.delete(), so after a delete the item and its remoteId both
survive and all three still answer yes.

Guarding only the landing (3741dc2) therefore fixed nothing on its own: the
other two republish the same id. Both now check the tombstone as well, on
remoteId, which is the id storage and the sidebar delete agree on. The reopen
falls through to the existing clear, which is what a nonce owning nothing looks
like.
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

createStudioDbAdapter files a materializing thread under the projectId its
closure holds, and useRemoteThreadListRuntime hands the core a fresh adapter on
every render through __internal_setOptions, so initialize() reads the provider's
LATEST project.

That used to be the same project the send was made in. Two things changed it.
assistant-ui's BaseComposerRuntimeCore.send() empties the composer and then
awaits every incomplete attachment through the adapter before calling
handleSend, and Studio's PDF, DOCX and text adapters do their extraction there,
so a document send reaches the runtime seconds after the click. And the shared
provider survives a project switch, so that late send is still alive to land:
before, switching projects unmounted the provider and it died with it.

Together: send a document into a new project chat, switch projects while it
converts, and the chat is created in, and persisted under, the project the user
switched TO.

The composer now stamps the send with its provider's project before send()
starts awaiting, and initialize() files the thread under that. Per send rather
than per thread creation, because switchToNewThread() reuses an untouched blank
thread, so one local id can be the current new thread in two projects in a row.
A claim of null wins too: it means the send was made from outside any project.
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff89e6aa82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 752 to 757
useEffect(() => {
if (compareRunning) return;
if (anyRunning && listedPairRef.current === pairId) return;
listedPairRef.current = pairId;
let isActive = true;
setThreadsSettled(false);
listStoredChatThreads({ pairId })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable compare sends until the first thread list settles

When an existing compare is opened while the retained base chat is still running, this exception starts the initial asynchronous list with both compare panes mounted on blank local threads, but SharedComposer remains interactive. If the user sends before listStoredChatThreads resolves, the prompt starts on those blank threads; the callback then installs the stored IDs, causing ThreadAutoSwitch to move both panes away mid-run and potentially persist duplicate threads for the pair. The same pattern is repeated in GeneralCompareContent; gate the composer until the initial list settles or defer applying the listed IDs if a compare run began meanwhile.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The window is real, but it is not this PR's and the exception did not create it.

At the merge base 27ca0c9 the same effect already started listStoredChatThreads asynchronously with threadsSettled false, and SharedComposer was rendered on active alone there too, with no threadsSettled gate anywhere in either variant. So on main, every ordinary compare open has this exact window: panes mounted on blank local threads, composer live, ids installed when the read resolves. Opening compare from a running base chat was reachable on main as well (that is #8908 itself, which killed the base run but still opened compare), so even the entry path you describe is not new.

What the first-list exception changed is which situations reach a window that already existed, not what happens inside it. Duration is the same single IndexedDB read, and the consequence is the same: ThreadAutoSwitch is not paused for a compare pane either before or after this PR, so the mid-run switch would behave identically.

So I am leaving it here rather than widening the PR further. Gating the composer on threadsSettled looks like the right fix and I think it is worth its own issue, since it also wants a decision about what the composer should show while the pair's threads load, which is a UX question this PR has no basis to answer.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: ff89e6aa82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment-only. Collapses the longest explanations to the fact that is not
recoverable from the code, and drops restatements of what the next line does.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c0847a45f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return;
}
if (!activeThreadId) {
if (resumed && pendingNewThreadId) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore project chats that materialize while compare is open

If the user sends from a project landing and opens Compare before the first history write publishes activeThreadId, pendingNewThreadId is still null when the landing is backgrounded. Both new publication paths deliberately stand down while backgrounded, so the run can materialize and finish without ever filling that state; on return this condition skips restoration even though the retained runtime's main thread now has a remote ID, leaving the completed conversation hidden behind the project overview. On resume, recover the materialized main thread from the retained runtime when pendingNewThreadId has not yet been observed, analogous to NonceThreadResumeRestore.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The window is real, but the restoration already happens; it just is not this condition that does it.

NonceThreadResumeRestore is enabled for the project landing too. The shared provider is handed newThreadNonce={projectNewThreadNonce} with no initialThreadId in project mode, so its enabled gate (base, no pairId, a nonce, no initialThreadId, not backgrounded) is satisfied, and it does exactly what you describe: on resume it reads mainThreadId off the retained runtime, requires a remoteId, and publishes it.

I did not want to take the effect ordering on trust, so I simulated it with both effects sliced verbatim and replayed with React's order (child before parent, then a re-render from the store write). On the resume commit: ProjectLanding runs first and skips, as you say; NonceThreadResumeRestore then publishes mainThreadId; the store write re-renders the landing, whose effect now sees a non-null activeThreadId that matches neither initialActiveThreadId (null, since openProjectLanding cleared it before the landing mounted) nor pendingNewThreadId, so it adopts and sets pendingNewThreadId. Result: activeThreadId and pendingNewThreadId both the materialized thread, and rotations: 0, so the rotate branch never fires and nothing is stranded.

So the landing does come back to the conversation. Leaving this as is rather than adding a second restore path that would race the first.

…h send paths

The project claim fixed one field on one path. The root cause is broader:
initialize() snapshots project, temporary status, model and creation time when
the thread MATERIALIZES, which used to be the same tick as the send. It is not
any more, because send() awaits document extraction and the shared provider
survives the view switch, and navigating in between moves all of them: the
adapter is rebuilt with the new project, and ChatPage's view effect clears
incognito for anything that is not a fresh single chat.

So a document sent from a Temporary Chat and followed by a project switch was
created and persisted as a normal project chat, with the content the user had
marked temporary. Same shape for the model the chat records.

The claim now carries the whole creation snapshot, and the prompt queue stamps
it too: that path calls initialize() on a fresh thread itself and never passes
the composer, so a queued first prompt was filed wherever the user had moved to,
and the run picked up that project's instructions and sources.

ensureThreadRecord already took all four as snapshot parameters for exactly this
reason; this is what lets the caller supply them from the send.
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

The creation claim fixed where the thread record is FILED. The run resolves its
project separately: createOpenAIStreamAdapter captures activeProjectId before
its first await and feeds it to rememberComposerProjectForRun, which decides the
instructions, RAG sources and sandbox the response is generated with.

Its comment already noted that a send survives navigation, and leaned on the
fallback only being consulted while the thread's row is missing. That is exactly
the window it is wrong in: initialize() returns without awaiting its row write,
so a fresh document send reaches the run with no row and, by then, possibly
another project on screen.

The run now prefers the same send-time stamp, so history and generation agree.
The claim is no longer consumed on read: its two readers, initialize() and the
run adapter, have no ordering guarantee between them, and releasing on the first
starved the second. Expiry bounds it instead, which is safe because a persisted
row makes ensureThreadRecord early-return and a fresh thread always gets a fresh
local id.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: f2d9372a20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 605941edae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1972 to +1974
if (switchStateNow.attempt !== attempt) return;
if (switchStateNow.activeNonce !== nonce) return;
clearAttachments();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable the composer while the new-thread switch is pending

When switchToNewThread() is delayed, the new-chat view already exposes an interactive composer while clearAfterSwitch remains armed. If the user attaches a file during that interval, it is added to the shared outgoing composer and this completion handler clears it along with the attachments that were intentionally being discarded, silently losing a file selected for the new chat. Gate the composer until this switch attempt lands, or clear only the attachment snapshot that existed when the switch began.

Useful? React with 👍 / 👎.

@danielhanchen
danielhanchen merged commit d668c28 into unslothai:main Aug 24, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Project chat interrupts in case change page

3 participants