Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion coderd/x/chatd/chatd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion coderd/x/chatd/store_chat_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion coderd/x/chatd/store_chat_attachment_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Loading