feat: add workspace awareness system message on chat creation#23213
Merged
feat: add workspace awareness system message on chat creation#23213
Conversation
c9e090d to
cacfeb3
Compare
When a chat is created, a system message is now inserted informing the model whether the chat was created with or without a workspace. This helps the model understand its available capabilities upfront: - With workspace: informs the model it can use workspace tools - Without workspace: instructs the model to create a workspace first
cacfeb3 to
c9ba52a
Compare
ethanndickson
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a chat is created via
chatd, a system message is now inserted informing the model whether the chat was created with or without a workspace.With workspace:
Without workspace:
This is a model-only visibility system message (not shown to users) that helps the model understand its available capabilities upfront — particularly important for subagents spawned without a workspace, which previously would attempt to use workspace tools and fail.
Changes:
coderd/chatd/chatd.go: Added workspace awareness constants and inserted the system message inCreateChatafter the system prompt, before the initial user message.coderd/chatd/chatd_test.go: AddedTestCreateChatInsertsWorkspaceAwarenessMessagewith sub-tests for both with-workspace and without-workspace cases.