diff --git a/coderd/x/chatd/chatd.go b/coderd/x/chatd/chatd.go index ee17c598257..824520e4cf1 100644 --- a/coderd/x/chatd/chatd.go +++ b/coderd/x/chatd/chatd.go @@ -623,7 +623,7 @@ func (c *turnWorkspaceContext) loadWorkspaceAgentLocked( } if !chatSnapshot.WorkspaceID.Valid { - return chatSnapshot, database.WorkspaceAgent{}, xerrors.New("no workspace is associated with this chat. Use the create_workspace tool to create one") + return chatSnapshot, database.WorkspaceAgent{}, xerrors.New("this tool requires a workspace and this chat does not have one. Use the create_workspace tool to create one") } if chatSnapshot.AgentID.Valid { diff --git a/coderd/x/chatd/store_chat_attachment.go b/coderd/x/chatd/store_chat_attachment.go index 2e8bd1f0acb..0c434dfcc65 100644 --- a/coderd/x/chatd/store_chat_attachment.go +++ b/coderd/x/chatd/store_chat_attachment.go @@ -35,7 +35,7 @@ func (p *Server) storeChatAttachment( data []byte, ) (chattool.AttachmentMetadata, error) { if !chatSnapshot.WorkspaceID.Valid { - return chattool.AttachmentMetadata{}, xerrors.New("no workspace is associated with this chat. Use the create_workspace tool to create one") + return chattool.AttachmentMetadata{}, xerrors.New("this tool requires a workspace and this chat does not have one. Use the create_workspace tool to create one") } storedName, mediaType, err := chatfiles.PrepareStoredFile(name, detectName, data) diff --git a/coderd/x/chatd/store_chat_attachment_internal_test.go b/coderd/x/chatd/store_chat_attachment_internal_test.go index 34c5d027d47..edefddb2ca6 100644 --- a/coderd/x/chatd/store_chat_attachment_internal_test.go +++ b/coderd/x/chatd/store_chat_attachment_internal_test.go @@ -159,7 +159,7 @@ func TestStoreChatAttachment_NoWorkspace(t *testing.T) { server := &Server{db: db} attachment, err := server.storeChatAttachment(context.Background(), database.Chat{}, "build.log", "build.log", []byte("build output")) - require.ErrorContains(t, err, "no workspace is associated") + require.ErrorContains(t, err, "this tool requires a workspace") require.Equal(t, chattool.AttachmentMetadata{}, attachment) }