Repository navigation
feat: allow creating chats without an initial message - #27111
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7668882d2b
ℹ️ 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".
7668882 to
d3555d9
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3555d9023
ℹ️ 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".
d3555d9 to
c40bd8b
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
c40bd8b to
f122e73
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f122e7371c
ℹ️ 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".
f122e73 to
ac548d3
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac548d37e3
ℹ️ 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".
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
2213a9e to
f35a4f3
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
jscottmiller
left a comment
There was a problem hiding this comment.
Approved. See the summary comment on #27078 and the non-blocking inline follow-ups across the stack.
Approval posted by Coder Agents on Scott's behalf.
f35a4f3 to
42ebc3a
Compare
42ebc3a to
cb10a9d
Compare
jscottmiller
left a comment
There was a problem hiding this comment.
Re-approved after the fix commits. Verified the addressed threads against the code (agent atomic publish, workspace status, normalized references, logging/metric, first-message fallback title, reasoning-effort override, Vitest coverage, archive-409 navigation) and ran the affected Go and Vitest suites; the remaining notes are acceptable as is. The three open follow-up threads are resolved as agreed follow-ups.
Approval posted by Coder Agents on Scott's behalf.
cb10a9d to
77d4887
Compare
77d4887 to
5bdbd68
Compare
Documentation CheckUpdates Needed
Automated review via Coder Agents |
POST /api/v2/chats now accepts an empty content array. The
chat is created idle in waiting status with system messages only and
no worker picks it up; generation starts with the first message POSTed
to /chats/{chat}/messages. This lets clients sequence work that needs
the chat ID before the first turn, such as workspace file uploads from
the new-chat page.
Chats created this way carry the "New Chat" placeholder title, which
automatic title generation now treats as replaceable when the first
message lands.
chatd.SendMessage now probes for prior user-visible messages under the chat row lock when the chat still carries the placeholder title, and on a direct insert persists FallbackTitle in the same transaction. It reports FirstUserTurn so postChatMessages schedules the async title upgrade without its out-of-band probe, and publishes a title_change event. postChats no longer schedules title generation for empty creates.
…y chats postChatMessages now applies the personal root override effort when the request omits reasoning_effort and the chat has no stored effort, which is the state after creating a chat without content. The override only applies when its model matches the model the send targets. The override lookup is extracted from resolveCreateChatModelConfigID into personalRootModelOverride so both paths share it.
5bdbd68 to
2d7438f
Compare

What
POST /api/v2/chatsnow accepts an emptycontentarray. The chat is created idle (waiting) with system messages only: no user message is inserted, no ownership hint is published, and no chat worker picks it up. Generation starts when the first message is POSTed to/chats/{chat}/messages.Why
The new-chat page needs to upload files into the chat's workspace before the first turn, and
POST /chats/{chat}/workspace-filesrequires a chat ID. There was previously no way to sequence "create chat, upload files, send first message": creation required non-empty content and started generation immediately. This PR adds the enabling primitive; the UI lands in the next PR of the stack.How
chatstate.CreateChattakes an explicitInitialStatus(waitingorrunning, validated). The existingIsRunnable()gate keeps ownership hints suppressed forwaitingchats.chatd.CreateChatderives the status fromInitialUserContent: empty content meanswaitingwith system messages only, andAPIKeyIDis only required when a user message is inserted.createChatInputFromRequestreturns empty blocks for empty content instead of rejecting; the/messagespath still rejects empty sends.New Chatplaceholder title. Title generation now treats that placeholder as replaceable. When the first message lands on such a chat,chatd.SendMessagedetects the first user turn inside its transaction (under the chat row lock), writes the fallback title in the same transaction, and reportsFirstUserTurn;postChatMessagesthen firesGenerateChatTitleForMessagesAsyncto upgrade it. A failed title call therefore still leaves a meaningful title.ARCHITECTURE.mdcarriesTODO (#27111)items in the transition list and thePOST /api/v2/chatssection for the newN -> Create -> Wtransition (the doc text and the diagram edge are left for the author per the chatd guardrail).Follow-ups
chats.last_reasoning_effortis derived from inserted messages, so an idle chat created withreasoning_effortdoes not persist it until its first message; the first message applies the owner's personal reasoning-effort override (when it targets the same model) if the request omits an effort, matchingPOST /chatswith content.Testing
N -> Wlands inStateWwith no ownership hint; invalid initial statuses are rejected.waitingchat with system messages only.W -> R0, inserts directly, not queued), immediate archive of an idle chat, workspace file upload against an empty-created chat, and title generation on the first message.