Repository navigation
Studio: queue chat prompts while generation is running - #6244
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors and enhances the prompt queue functionality in thread.tsx by renaming variables for clarity, adding a reset helper, and allowing text prompts to be queued while a response is currently running. The review feedback highlights two critical issues: a potential bug where a pending setTimeout could still append a prompt after the queue is stopped, and a race condition when waiting for a current run that could cause the queue to hang if the run finishes before the subscription is active.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d39c0f7554
ℹ️ 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".
d39c0f7 to
4e39cbe
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55a0c17bd3
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb27b6aa8a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fafca33a33
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93e8ce0115
ℹ️ 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".
# Conflicts: # studio/frontend/src/components/assistant-ui/thread.tsx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bcd84c40a8
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba9c971afe
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d529ec38e
ℹ️ 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".
|
|
||
| function appendQueuedPrompt(item: PromptQueueItem) { | ||
| syncPromptQueueUI(); | ||
| item.target.append(item.prompt); |
There was a problem hiding this comment.
Snapshot tool settings when queueing prompts
When a prompt waits in the queue and the user changes composer settings before it dispatches (for example navigating to another chat and toggling RAG/web/code or switching KB source), this delayed append starts the run with whatever useChatRuntimeStore values are current at dispatch time; chat-adapter.ts re-reads toolsEnabled, ragEnabled, and ragSource when a run starts. As a result, a queued prompt can silently lose retrieval/tools or use a different source than the user had selected when they queued it, which changes the answer for otherwise identical prompt text.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch, but I’m going to scope this out of this PR.
The queue currently preserves prompt ordering and target thread behavior, while chat run options are still sourced from the runtime store at run start. Snapshotting tool/RAG/KB settings per queued item needs a more deliberate per-run settings path in the adapter; a local save/restore around append() would be racy because the adapter re-reads store state after async waits.
I’d rather handle that separately than expand this PR further.
# Conflicts: # studio/frontend/src/components/assistant-ui/thread.tsx # studio/frontend/src/features/chat/runtime-provider.tsx

Summary